log4j - grep-friendly logging of stack traces -


i lot of grepping through logs generated java's log4j , python's logging module. both create stack traces include newline characters, causing log entry span multiple lines. makes things hard find grep , violates conventional log file formatting rules (one entry per line).

if find interesting in stack trace, have open entire log file (which can large) , browse line grep found, scroll find start of log entry. feels kludgey.

is there better way handle this? perhaps removing newline characters stack traces somehow?

thanks suggestions!

if have gnu grep can use -c (aka --context) switch:

-c num, --context=num
print num lines of output context. places line containing -- between contiguous groups of matches.

i'm not sure if -c part of posix grep worth shot.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -