Log4j overwriting logs! ..sometimes...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Log4j overwriting logs! ..sometimes...
# 1  
Old 03-12-2008
PHP Log4j overwriting logs! ..sometimes...

Hey,
hoping someone here can help me. I'm using log4j for logging in a Java server. Its using DailyRollingFileAppender and rolls every hour. The reason I'm posting here is that in windows it works fine, but in unix it doesnt. What happens is the logs are logged in a file, lets say 'requests'. Then every hour the requests are rolled. so after the first hour of the day we would have the file 'requests-08-03-12-01.log'. Then requests for the current hour will be logged in requests again. Problem is that if we stop the server then restart what happens is that the requests that were currently logged in 'request' get written to the previous log file, overwriting any existing info. This doesnt happen in windows. Also I read about changing directories and it seems to work if we log to a different directory, i.e. it doesnt overwrite anything on restart. So any ideas as to why when we use this directory we have this issue?

Thanks.
# 2  
Old 03-12-2008
Anyone?

Short version : Up server restart log4j is overwriting the previous logs.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Log4j combining lines to single line

Hi, Our log4j file contents look like this: 2018-11-20T00:06:58,888 INFO ql.Driver: Executing command(queryId=hive_20181120000656_49af4ad0-1d37-4312-872c-a247ed80c181): CREATE TABLE RESULTS.E7014485_ALL_HMS_CAP1 AS SELECT name,dept from employee Where employee='Jeff'... (4 Replies)
Discussion started by: wahi80
4 Replies

2. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies

3. UNIX and Linux Applications

Logrotate with catalina.out "daily compressed file is overwriting the logs"

Hi Everyone, We are trying to do a logrotate for "catalina.out" daily, So have used the "copytruncate" option in the logrotate configuration but ended up seeing there was a 0kb file touched with "catalina.out" and the other file with the current date(compressed) file created and seems the log is... (2 Replies)
Discussion started by: thiyagoo
2 Replies

4. Shell Programming and Scripting

File overwriting

Hi, An application is transferring a file to linux system with same file name. As file is transferring with same name always file will be overwritten. In this case we want to know what times file was overwirtten like below. Modify: 2014-05-12 00:52:01.000000000 Modify: 2014-05-12... (2 Replies)
Discussion started by: Satyak
2 Replies

5. UNIX Desktop Questions & Answers

overwriting on a file

I have loads of files in different directories which I do miner changed on them and till now I have to create totally new directories for them, specially as I deal with a whole directory at once :wall::wall::wall::wall: it creates such as mess really e.g. FILES="F1/*" for X in $FILES do... (2 Replies)
Discussion started by: A-V
2 Replies

6. Shell Programming and Scripting

Change values in Log4j.xml using ksh script

Hi, I am new to UNIX and shell scripting. I have to create a shell script(ksh) which parses log4j.xml file for a given webservice name and change the corresponding value from INFO to DEBUG or vice-versa. My log4j.xml looks like:- <!-- Appender WEBSERVICENAME--> <appender... (3 Replies)
Discussion started by: sanjeevcseng
3 Replies

7. UNIX for Dummies Questions & Answers

log4j - my unix version

Hi, I am starting to do a log4j framework but with unix shell script. So, this framework, will create the log file, will put all info in there, and will close the log file. He will only work whenever he is called by the father script. Now, I want him to be able to work with different father... (6 Replies)
Discussion started by: pipoca
6 Replies

8. Shell Programming and Scripting

Overwriting File

How to overwrite every time a particular portion of a file? ---------- Post updated at 02:16 PM ---------- Previous update was at 02:07 PM ---------- I have a file whose contents are something like: Output of "apachectl fullstatus" command: ---------------------------------------------... (3 Replies)
Discussion started by: proactiveaditya
3 Replies

9. Shell Programming and Scripting

Grep yesterday logs from weblogic logs

Hi, I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows: """"""""""""""""""""""""""... (3 Replies)
Discussion started by: harish.parker
3 Replies
Login or Register to Ask a Question