---
# System prepended metadata

title: Notes for Logging strategy
tags: [By_Ivan_note]

---

# Notes for Logging strategy
###### tags: `By_Ivan_note`
This document contains some of my ideas relevant to application logging.

The thoughts are expressed from the developer's perspective. Also, Some of them could be useful when building learning models on syslog.

## Logging from dev's perspective

#### Purpose of doing logging
1. Find potential improvements
2. Search for mulfunctions
3. Trace back the events

To sum up, giving informations for which it could help fixing the problem.

#### Log message should contain

1. User involved
2. Time
3. Which application, and where
4. What casue
5. OS / Platform


#### Who should be watching the logs
It differs from the target user.


#### Challenges
1. Memory flooding
2. Trash information prventing those important ones to be seen
3. Time overhead

## Some misc thoughts

### Strategy
1. Seperate errors and other log message
2. Delay logging (filter out and record the necessary messages, after some evaluation)
3. Record everything, but maintain(remove) them actively

### Access log format
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined </br>
LogFormat "%h %l %u %t \"%r\" %>s %b" common


### Factors
Factors that should be concidered when deciding which information to log:
1. When? the timing of the event and its scenario
2. How? emergency level, is it important enough to record?
3. What? what trigger this error (or notification)? 

