Background: I inherited a web application designed to create on-the-fly connections between local and remote equipment. Recently, a huge number of moving parts have appeared: the application itself has changed a lot; development tools have just been updated; and both local and remote equipment have been “modified” to support these changes.
The bright side is that it has a reasonable logging system that will write debugging messages to a file and will be logged both in the file and in real time. I have the opportunity to rework the entire logging / debugging mechanism.
<strong> Examples:
Question: What are the best practices you have used as a developer or seen as a consumer that generate useful logs and debugs?
Edit: Many useful suggestions for now, thanks! To clarify: I'm more interested in what to register: content, format, etc. - and the reasons for this - than specific tools.
, , ?
!
, , - "1 ", , , .
, .
(log4net, log4java, log4++)
, . , .
, , , , , grep through, .
, , :
→ , timestamped, ( )→ -, , ./ → , , , , / , , ..
, - / , grep -A 50 -B 50 'timestamp' tracing_file, .
grep -A 50 -B 50 'timestamp' tracing_file
EDIT: , , python, . - , . , , , .. 1 - , 2 - , 4 - , 7 3 ..
, . , . , . , ...
Coding Horror guy , .
, , . . , , , . : , , .
. , hudge, ( )...
, , . / , 1-5, , ,
, " ".
, :
Java, API Java.
API
Simple Facging Facade Java (SLF4J) - , :
SLF4J - logback - , API SLF4J.
Use an existing logging format, such as that used by Apache, and then you can combine many of the tools available to analyze the format.