[logback-user] Lots of newbie questions :P

Nitro Star nitrostar1 at gmail.com
Wed Sep 9 20:17:45 CEST 2009


I have been playing with logback for a couple of days and find a lot of its
functionality amazing! I have a couple of questions that I was wondering if
I could address!

I'm using logback to log information about a java server that I'm setting
up. I want my log files to change every half hour and to never exceed 500MB.
I would also like the logging system to cache 16MB of data before flushing
to disk! Finally, I want the fileNamePattern to depend on the hostname where
I'm running the server!

So this are my questions:
a. I have found a way for the log files to change every hour, but not every
half hour... Is there a way to do this? Is there a way I can define my own
b. Is there a way for me to define the fileNamePattern somewhere else other
than in the logback.xml file?
c. Is there a flush() function I can call when my server exists?

For b. I have tried something like:

LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
        Logger logger = lc.getLogger("ROOT");

        RollingFileAppender<ILoggingEvent> app =
        RollingPolicyBase rollingPolicy =


But that doesn't seem to work :(

I'm attaching my current logback.xml file.

Any and all help would be much appreciated!

Also, I tried visiting #qos.ch in freenode, but there's noone there except

Thanks again,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20090909/211a1309/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logback.xml
Type: text/xml
Size: 918 bytes
Desc: not available
URL: <http://qos.ch/pipermail/logback-user/attachments/20090909/211a1309/attachment.bin>

More information about the Logback-user mailing list