File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes logging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "logging" Watch "logging" New topic
Author

logging

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Hi,
In our production environment, we have log files created every 1 Hr on average. Size of file varies.sometimes goes upto 50MB.In UNIX environment we use grep command to search particular record. But this method of viewing request is not very user friendly.
What are varios methods to search the strings in multiple log files?


MH
Pallu Sagar
Greenhorn

Joined: Dec 04, 2009
Posts: 16
find . -exec grep "www.athabasca" '{}' \; -print
This command will search in the current directory and all sub directories. All files that contain the string will have their path printed to standard output.

If you want to just find each file then pass it on for processing use the -q grep option. This finds the first occurrance of the search string. It then signals success to find and find continues searching for more files.

find . -exec grep -q "www.athabasca" '{}' \; -print


-Sagar
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Thanks.
Suprisingly I also found the above text here
Pallu Sagar
Greenhorn

Joined: Dec 04, 2009
Posts: 16
yeah, does it solved your prob ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

"The Sagar", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 860
Check out splunk. It is software that does exactly what you want with a web interface. It is also free with limited use. You should be able to download it and load your logs into it in a few minutes.

http://www.splunk.com

an intro video
http://www.splunk.com/view/SP-CAAAEZY


http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
 
 
subject: logging
 
Similar Threads
WebSphere 3.5 starting problem
Unable to log to file
Read log files incrementally (as they are written)
weblogic log creation for webapps
advanced technology than RMI for developing Distributed applications?