Apache log files

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

SU@Haringey
Ebase User
Posts: 3
Joined: Thu Sep 20, 2007 1:08 pm

Apache log files

#1

Postby SU@Haringey » Thu Sep 20, 2007 1:28 pm

Hi there,

I was wondering if we have any apache tomcat experts here! :D

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
0 x

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

#2

Postby AJDulk » Fri Sep 21, 2007 12:24 pm

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
0 x

SU@Haringey
Ebase User
Posts: 3
Joined: Thu Sep 20, 2007 1:08 pm

#3

Postby SU@Haringey » Fri Sep 21, 2007 2:56 pm

Whichever Apache is used with the latest ebase release. Tomcat 5.5?
0 x

Steve
Moderator
Moderator
Posts: 419
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#4

Postby Steve » Thu Sep 27, 2007 11:21 am

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 :

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 &#91;%-5c&#123;1&#125;&#93; %7p - %C&#123;1&#125;.%M&#40;%L&#41; &#58; %m\n
with

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 &#91;%-5c&#123;1&#125;&#93; %7p - %C&#123;1&#125;.%M&#40;%L&#41; &#58; %m\n
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.
0 x

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

Apache Tomcat Log Files

#5

Postby AJDulk » Thu Sep 27, 2007 12:12 pm

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
0 x

Steve
Moderator
Moderator
Posts: 419
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#6

Postby Steve » Thu Sep 27, 2007 12:33 pm

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
0 x

SU@Haringey
Ebase User
Posts: 3
Joined: Thu Sep 20, 2007 1:08 pm

Thanks ....

#7

Postby SU@Haringey » Wed Oct 10, 2007 3:17 pm

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
0 x


Who is online

Users browsing this forum: No registered users and 13 guests