This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes changing the log file content Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Reply Bookmark "changing the log file content" Watch "changing the log file content" New topic
Author

changing the log file content

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1854
Hi,
In our environment, one application writes a logs in text format.Log file size goes upto 25MB .Log file rotation is used.
We want to modify the data(immediately) in the log file if record matches some expression. In what language program should be written?
Does the program need to poll the log file continuously?
Operating System is Solaris and we have Java/PERL installed.(and ofcourse SED/AWK).

Thanks


MH
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5536

You might have a better chance of getting this answered in the Linux forum, I'll move it there.


JBoss In Action
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8436

In what language program should be written?
Does the program need to poll the log file continuously?


If you are considering Java, check out JNotify


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1854
Thanks. I think SED will be good option as its alread there. Ouput of log file will be piped to Shell Script where I am writing SED regular expression and then printing it out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: changing the log file content
 
Similar Threads
log4j config file setup
How can we get file Inode info using java?
Log in Servlet
log method of servlet context
Logging problem in websphere