Hi there,
I was wondering if we have any apache tomcat experts here!
How do we configure our apache web server, so that at the end of a given time period (e.g. a day or a week), it will automatically create a new log file and archive the old one?
Thanks for any light you can shed.
SU
Apache log files
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 94
- Joined: Fri Sep 14, 2007 12:18 pm
- Location: The Netherlands
- Contact:
Hi Su,
Are you asking about the Apache Web Server or Apache Tomcat?
Also what version are you talking about?
The approach is different in each case, for example see:
- Apache Web Server 2.2 - Log Rotation
- Apache Tomcat 6.0 - Logging
Regards,
Antony den Dulk
Are you asking about the Apache Web Server or Apache Tomcat?
Also what version are you talking about?
The approach is different in each case, for example see:
- Apache Web Server 2.2 - Log Rotation
- Apache Tomcat 6.0 - Logging
Regards,
Antony den Dulk
0 x
-
- Ebase User
- Posts: 3
- Joined: Thu Sep 20, 2007 1:08 pm
-
- Moderator
- Posts: 419
- Joined: Fri Sep 07, 2007 3:44 pm
- Location: Sandy, UK
- Contact:
Hi Su,
You can make the log files roll over each day by changing the log4j.properties file located in : <ebase_install_directory>/UfsServer/tomcat/common/classes directory.
You need to replace the following :
with
You will need to do that for each of the log file appenders: log4j.appenderRequests, log4j.appenderXAPool and log4j.appender.Log4J
To change the time to roll over you just need to change the log4j.appender.Log4J.DatePattern to a different pattern.
e.g
log4j.appender.[Appender].DatePattern='.'yyyy-MM-dd-HH-mm rolls the logs over every minute.
For more information about the patterns see http://logging.apache.org/log4j/1.2/apidocs/index.html
I hope this helps.
You can make the log files roll over each day by changing the log4j.properties file located in : <ebase_install_directory>/UfsServer/tomcat/common/classes directory.
You need to replace the following :
Code: Select all
log4j.appender.Log4J=org.apache.log4j.RollingFileAppender
log4j.appender.Log4J.File=../logs/ebase.log
log4j.appender.Log4J.MaxFileSize=100MB
log4j.appender.Log4J.MaxBackupIndex=5
log4j.appender.Log4J.layout=org.apache.log4j.PatternLayout
log4j.appender.Log4J.layout.ConversionPattern=%10r [%-5c{1}] %7p - %C{1}.%M(%L) : %m\n
Code: Select all
log4j.appender.Log4J=org.apache.log4j.DailyRollingFileAppender
log4j.appender.Log4J.File=../logs/ebase.log
log4j.appender.Log4J.DatePattern='.'yyyy-MM-dd
log4j.appender.Log4J.layout=org.apache.log4j.PatternLayout
log4j.appender.Log4J.layout.ConversionPattern=%10r [%-5c{1}] %7p - %C{1}.%M(%L) : %m\n
To change the time to roll over you just need to change the log4j.appender.Log4J.DatePattern to a different pattern.
e.g
log4j.appender.[Appender].DatePattern='.'yyyy-MM-dd-HH-mm rolls the logs over every minute.
For more information about the patterns see http://logging.apache.org/log4j/1.2/apidocs/index.html
I hope this helps.
0 x
-
- Ebase User
- Posts: 94
- Joined: Fri Sep 14, 2007 12:18 pm
- Location: The Netherlands
- Contact:
Apache Tomcat Log Files
Hi Steve,
Thanks for replying to this. As I understand it, this applies for the Tomcat Logs. If I am correct, (from a little research in order to answer this question) the Ebase Server Log setup in UFSSetup.properties will not be affected by this. I get the impression that you are manually creating the Ebase Server Log. If this is so, when are Ebase planning to implement log4j for this?
I also noticed that Ebase has the logkit.jar (1.01) in the web-inf/lib subdirectory. LogKit seems to have disappeared into the Excalibur project and is no longer maintained as a separate product (Though it may be extractable from Excalibur with some effort) so it looks like something to deprecate in Ebase if it is still being used. If Ebase is using LogKit, the last version produced before it was incorporated into Excalibur is 1.2.
Regards,
Antony
Thanks for replying to this. As I understand it, this applies for the Tomcat Logs. If I am correct, (from a little research in order to answer this question) the Ebase Server Log setup in UFSSetup.properties will not be affected by this. I get the impression that you are manually creating the Ebase Server Log. If this is so, when are Ebase planning to implement log4j for this?
I also noticed that Ebase has the logkit.jar (1.01) in the web-inf/lib subdirectory. LogKit seems to have disappeared into the Excalibur project and is no longer maintained as a separate product (Though it may be extractable from Excalibur with some effort) so it looks like something to deprecate in Ebase if it is still being used. If Ebase is using LogKit, the last version produced before it was incorporated into Excalibur is 1.2.
Regards,
Antony
0 x
-
- Moderator
- Posts: 419
- Joined: Fri Sep 07, 2007 3:44 pm
- Location: Sandy, UK
- Contact:
Hi Anthony,
You are correct to say that this is for the tomcat logs only. The ebase.log, logs everything that you would normally see all the console output (Log4J Appender).
Converting the internal Ebase log (ufsserver.log) to Log4J is not on our agenda, but perhaps we might look into this.
The reason we have the LogKit in the Web-INF/lib is because Apachy Velocity requires it. This is used in the formattemplate() function. This maybe resolved by apache when they release a later version?
Kind regards
Steve
You are correct to say that this is for the tomcat logs only. The ebase.log, logs everything that you would normally see all the console output (Log4J Appender).
Converting the internal Ebase log (ufsserver.log) to Log4J is not on our agenda, but perhaps we might look into this.
The reason we have the LogKit in the Web-INF/lib is because Apachy Velocity requires it. This is used in the formattemplate() function. This maybe resolved by apache when they release a later version?
Kind regards
Steve
0 x
-
- Ebase User
- Posts: 3
- Joined: Thu Sep 20, 2007 1:08 pm
Thanks ....
all for your comments. Unfortunately I think we need to format the ebase logs as suggested in the previous post.
Thanks for your help.
SU
Thanks for your help.
SU
0 x
Who is online
Users browsing this forum: No registered users and 13 guests