About
A log is a text file with:
- a timed list of message (activities)
- that an application has performed
Example
- execution/request log:
- web server:
- web log (Apache - Web Log (Activity Log) - that stores the Http request
- error
- cron
- connection log:
- ftp
- ssh (/var/log/secure)
Usage
- Debugging: Inserting log statements into code is a low-tech method for debugging it.
- For data log as a fault tolerance purposes (Undo/Redo) in a database. See Data Management - (Transaction|Request|Commit|Redo) Log
- Analytics: Because it's hard to know in advance what data might be useful to analyze, a common approach is to log it all and sort through it later.
- Distributed Services: Distributed - Tracing
- Security: The log activity can be monitored in order to track suspicious activity (example ssh login for instance)
Structure
The basic structure of a log entry is:
- a timestamp
- a text message
- optional extra attributes
Server Application
Because:
- they are point in time event registration, they fall in the category of time serie
- they stores text message, the log platorms are specialized search engine.
Management
Creator
The creation of log is done via a library.
Example of Java Logger Library
Format
Processing
When the log file are becoming too big, you need to:
- or rotate them
(Standard|Specification)
Severity / Level
Generally, a level value is present in a log line that specifies the order of severity. See Logging - Level