Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Log file rotation

Joakim, thank you very much. I will look in to using SLF4J and see how it goes. Thanks again,

Charles 


On Sep 10, 2010, at 4:34 PM, Joakim Erdfelt wrote:

Not natively with JettyLog, it's a default impl is to route to StdErr and then ${jetty.home}/etc/jetty-logging.xml routes the stderr to the logs/ directory.

With Jetty 7.x you have 2 options.
Both require you to tell Jetty what kind of advanced logger you want to use.
* java.util.logging
* SLF4J

- java.util.logging -
Set a system property called "org.eclipse.jetty.util.log.class" to "org.eclipse.jetty.util.log.JavaUtilLog" and from there you have all of the standard java.util.logging configuration options to write to a file / roll the log / etc ...

- SLF4J -
You'll want to setup SLF4J, have JettyLog use its SLF4J impl.
The mere existence of slf4j-api.jar in the classpath is enough to trigger this behavior.
Download the slf4j-api.jar of your choice, and put it in ${jetty.home}/lib/ext
Be sure you checkout $ java -jar start.jar --version to see if it will load into the Jetty Classpath (not your webapps)

Then you'll want to worry about how to take the SLF4J produced logging events and route them to a logging impl you like.
Check out the docs at http://*slf4j.org/ to understand how to setup slf4j.
For example: you can have SLF4J use log4j to write the logs to disk.

I personally like logback http://*logback.qos.ch/ opposed to log4j, as it allows me greater log routing control than log4j alone.
(Example: I can route all commons-logging & log4j & java.util.logging & slf4j & stderr & stdout generated logging events to a file controlled by the logback configuration under slf4j)

- Joakim

On Fri, Sep 10, 2010 at 4:21 PM, Heizer, Charles <heizer1@xxxxxxxx> wrote:
Hello, does jetty 7 support some type of log file rotation. My logs are getting really big.

Thanks,
Charles

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://*dev.eclipse.org/mailman/listinfo/jetty-users

<ATT00001..txt>

--
Charles Heizer
Systems Management Solutions Group
Lawrence Livermore National Laboratory
P: 925-422-0197




Back to the top