The instructions are updated on the stackoverflow side.

http://stackoverflow.com/a/15477278/775715

Joakim Erdfelt / [email protected]

On Wed, Jun 22, 2016 at 12:08 PM, Darsh <[email protected]> wrote:

> I tried to configure jetty logging with apache Log4j as per the
> instruction here
>
>
> http://stackoverflow.com/questions/15474476/how-to-configure-jetty-to-put-logs-into-an-external-file
>
> These are my configs. I have all the required jars under lib/logging
>
> 1) I have *--module=logging* in jetty_base/start.ini
>
> 2) jetty_base/resources/log4j.properties
>
>
> # Basic Log4j Configuration with STDOUT and File logging
>
> log4j.rootLogger=INFO, CONSOLE, ROLLINGFILE
>
> log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
>
> log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x -
> %m%n
>
> log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
>
> log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.ROLLINGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x
> - %m%n
>
> log4j.appender.ROLLINGFILE.File=/var/log/jetty/jetty.log
>
> #log4j.appender.ROLLINGFILE.DatePattern='.'yyyy-MM-dd
>
> log4j.appender.ROLLINGFILE.MaxFileSize=10MB
>
> log4j.appender.ROLLINGFILE.MaxBackupIndex=10
>
> log4j.appender.ROLLINGFILE.append=true
>
> 3) jetty_base/resources/jetty-logging.properties
>
> org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
>
>
> I see jetty.log file under log directory with following output
>
> 2016-06-22 19:05:35 INFO  log:186 - Logging initialized @533ms
>
> 2016-06-22 19:05:35 INFO  log:? - Redirecting stderr/stdout to
> /var/log/jolokia_proxy/2016_06_22.stderrout.log
>
> 2016-06-22 19:05:36 INFO  Server:345 - jetty-9.3.10.v20160621
>
>
>
>
> but I also see default log file i.e
>
> *2016_06_22.stderrout.log and it does rotate with every restart. How can I
> get rid of this file? Default logger should turn off when we configure
> with apache Log4j? *
>
> I'm using jetty version 9.3.10.v20160621
>
>
>
>
> Thanks
>
> DP
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to