[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #18922 [Metrics/CollecTor]: configure logging via properties file
#18922: configure logging via properties file
-------------------------------+------------------------------
Reporter: iwakeh | Owner: iwakeh
Type: defect | Status: needs_review
Priority: Medium | Milestone:
Component: Metrics/CollecTor | Version:
Severity: Normal | Resolution:
Keywords: ctip operation | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
-------------------------------+------------------------------
Comment (by iwakeh):
Replying to [comment:4 karsten]:
> Few questions before merging:
> - Can we have separate log files for each module? These modules may be
executed concurrently, and using a single log file might cause problems
and also make the log file less readable.
Yes. The way to have different log-files is hidden in a comment in run-
all:
{{{
# this would use a special log config for each module
# java -Xmx2g
-Djava.util.logging.config.file=./bin/logging.$TOKEN.properties -jar
collector-0.9.0-dev.jar $TOKEN
}}}
This makes each module use different logging properties, i.e.
`logging.relaydescs.properties` for relaydescs,
`logging.bridgedescs.properties` for bridgedescs, etc.
These logging properties can just be a copy of `logging.properties` each
with a different entry for the log file name, but of course also other
differences (level or excluded packages ...)
> - Can we merge `bin/logging-properties` with the new config file, or
would that confuse the Java Logging API? What about future logging
frameworks we're going to switch to?
Well, if I understand the question correctly: that I would have to try in
order to give a definite answer. Usually java util logging ignores what it
doesn't understand, but I would not rely on that.
Logging should be separated from the runtime configuration. And, because
of the upcoming change of logging frameworks I wouldn't want to merge the
logging properties with other configuration.
For a switch to slf4j and logback, for example, we would remove all java
util logging properties and have an XML logging config like for Onionoo.
In that case, just one file for all the different modules and logging
purposes (i.e. monitoring, diagnostics, and statistics).
> - Would you want to remove the five files `bin/run-*` and only keep the
new `bin/run-all` that accepts a module name as parameter? Or is that a
change we should postpone?
Well, I intended to make things backward compatible by keeping the old
shell scripts. So the crontab entries don't need to be touched.
And, currently run-all expects the old shell-script name (incl. the `run-`
part) and extracts the module name (see variable `TOKEN`).
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/18922#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs