Closed grtjn closed 4 days ago
CoRB uses the Java java.util.logging.Logger.
You can customize the behavior of the logger by applying your own logging.properties when you launch:
-Djava.util.logging.config.file=logging.properties
With the logging.properties looking something like:
# Logging
handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
.level = ALL
# File Logging
java.util.logging.FileHandler.pattern = corb-out.log
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level = INFO
# Console Logging
java.util.logging.ConsoleHandler.level = ALL
And then you can probably provide the log file name from command line as well, I guess, or if needed, all those values?
Yes, that's what I meant when I showed -Djava.util.logging.config.file=logging.properties
to specify the file that has those logging properties.
It would have been nice if you could pass through a unique filename for the log from the command-line, but that appears not to be possible. We are running Corb headless from NiFi. We are now generating log properties with unique names at each run, and removing them afterwards. Bit cumbersome, but it works. Thanks..
Hi,
We'd like to write log messages both to console and to file to be able to retrieve them more easily for processing and storing from NiFi. Using the ordinary linux redirect with > and such doesn't work well from within NiFi, so we are looking to provide params that will tell logging to write to a file as well as to console. Any ideas?
Cheers