logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



How to limit the size of stdout and stderr log files in log4

 
Post new topic   Reply to topic    Apache Forum Index -> Other Software



View previous topic :: View next topic  
Author Message
pKumar4Forum



Joined: 21 Apr 2016
Posts: 1
Location: India, Pune

PostPosted: Thu 21 Apr '16 8:31    Post subject: How to limit the size of stdout and stderr log files in log4 Reply with quote

Hello,

I need to limit the size of stdout and stderr log file which is automatically created on tomcat>log location. I am using tomcat7 and windows
I used may configuration but it is not working.
Please suggest me how to limit the size of log file or roll these files.

I used
log4j.appender.stderr = org.apache.log4j.ConsoleAppender
log4j.appender.stderr.Threshold = WARN
log4j.appender.stderr.Target = System.err
log4j.appender.stderr.layout = org.apache.log4j.PatternLayout
log4j.appender.stderr.layout.ConversionPattern = %-5p %d [%t][%F:%L] : %m%n

I did changes in context.xml of conf folder
Context swallowOutput="true"

Tried other configuration also but nothing happen.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6225
Location: Germany, Next to Hamburg

PostPosted: Sun 24 Apr '16 18:26    Post subject: Reply with quote

I don't do anything in java, but I searched and found this to redirect those errors to a different file

http://sysgears.com/articles/how-to-redirect-stdout-and-stderr-writing-to-a-log4j-appender/

and the last mail on http://apache-logging.6191.n7.nabble.com/RE-redirecting-Stdout-and-stderr-to-a-different-log-file-td9112.html
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Other Software
Page 1 of 1