I was recently struggling to work out how to set up my own log file with custom formatting in avalon. I've figured it out now but was thinking that some comments in environment.xml would have helped me a great deal. Below (and attached) is an example of a commented environment.xml that I'd have found more useful. Maybe this could be submitted as a patch?
<?xml version="1.0"?> <!-- README! Basic config file that sets up context for server application. --> <environment> <logs> <category name="" target="default" priority="DEBUG" /> <log-target name="default" location="/logs/default.log" /> <!-- - to have your application create its own log file simply add a new - category and new log-target here, e.g. - - <category name="helloworld" target="hw-logger" priority="DEBUG" /> - <log-target name="hw-logger" location="/logs/hw.log" /> - - where "helloworld" is the alias of your application class that - implements the LogEnabled interface --> <!-- - to alter the formatting of a log file use the 'format' attribute in - the log-target, e.g. - - <log-target name="hw-logger" location="/logs/hw.log" - format= "%15.15{time:MMM dd HH:mm:ss} : %{message}\n" /> - - other formatting options are available, for more detail look at - http://jakarta.apache.org/avalon/logkit/whitepaper.html --> <category name="helloworldcron" target="hw-logger" priority="DEBUG" /> <log-target name="hw-logger" location="/logs/hw.log" format= "%15.15{time:MMM dd HH:mm:ss} [%{context:hostname}] %{category}: %{message}\n" /> </logs> <policy> <grant code-base="sar:SAR-INF/lib/*"> <permission class="java.security.AllPermission" /> </grant> </policy> </environment> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>