views:

57

answers:

3

I'm trying to collect some advices on error logging in java. My log file is huge and going trough it is time consuming, currently I'm grep(ing) my log looking for error(ERROR) pattern, and then looking at line which threw exception then I search/find it and check out the error.

Is there some better way of reading log files more efficiently? Currently my focus is on errors/exceptions only.

I've titled my question wrongly(edit)

I'm not interesting about logging, I'm interested about log processing(post-logging) process, I have the log and I have to get useful information from it(for me errors).

+1  A: 

You don't say what you're using for a logging framework, but I believe that Log4J will allow you to split different levels to different appenders.

And it looks like this question shows how: http://stackoverflow.com/questions/2154539/log4j-log-level-per-appender-for-a-single-logger

Anon
+3  A: 

If you are using log4j I recommend you to take a look at Chainsaw: http://logging.apache.org/chainsaw/index.html

Alois Cochard
+1  A: 

If you're looking for simplicity and good community support, I'd try Microsoft's Log Parser. It uses a SQL-like query system to search logs in any format.

Alasdair