Commit b576c8ee authored by Kyle Sunden's avatar Kyle Sunden

Merge branch 'logging-location' into 'master'

change logging location

See merge request !45
parents 03f45ddc 719ca7b2
Pipeline #178045526 passed with stage
in 1 minute and 3 seconds
......@@ -5,6 +5,7 @@ author: Kyle Sunden
status: accepted
tags: standard
post-history: 2020-05-13
2020-08-14
---
# Abstract
......@@ -48,7 +49,7 @@ Individual log entries SHALL be of the format:
{level} : {timestamp} : {name} : {message}
```
Where `{level}` is the log level, with the numeric prefix and the abbreviation for readability (e.g. `<6> INFO`), `{timestamp}` is a valid [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp with at least second precision and timezone specified, `{name}` is the name of the specific daemon which initiated the log entry (or `yaqd_core` if it was initiated outside of a daemon) and `{message}` is an arbitrary message string.
Where `{level}` is the log level, with the numeric prefix and the abbreviation for readability (e.g. `<6> INFO`), `{timestamp}` is a valid [ISO-8601 extended](https://en.wikipedia.org/wiki/ISO_8601) timestamp `%Y-%m-%dT%H:%M:%S%z` with at least second precision and timezone specified, `{name}` is the name of the specific daemon which initiated the log entry (or `yaqd_core` if it was initiated outside of a daemon) and `{message}` is an arbitrary message string.
For example:
......@@ -72,16 +73,14 @@ There SHALL be `--log-level` and the short form `-l` which takes the string name
Because the log format was chosen to work well with external systems, some users may opt to record logs using external tools which read the stderr output.
However, an internal implementation of log file storage SHALL be provided.
The files MUST be timestamped (ISO-8601 with second precision and offset) and located in the same folder as the [YEP 103](../103) state files.
The file names MUST begin with the daemon names.
For example:
```
macOS: `~/Library/Application Support/yaqd-state/<kind>/<name>-<timestamp>.log`
Linux: $XDG_DATA_DIR/yaqd-state/<kind>/<name>-<timestamp>.log
Windows: `C:\Users\<User>\AppData\Local\yaq\yaqd-state\<kind>\<name>-<timestamp>.log`
```
The file names MUST begin with the daemon names, followed by a dash `-`.
The files names MUST end with a timestamp ([ISO-8601 basic](https://en.wikipedia.org/wiki/ISO_8601#Times), `%Y%m%dT%H%M%S%z`), followed by the file extension `.log`.
Files will be located in the operating system's user log directory.
Patterns for each supported operating system follow:
- macOS: `~/Library/Logs/yaqd-<kind>/<name>-<timestamp>.log`
- Linux: `~/.cache/yaqd-<kind>/log/<name>-<timestamp>.log`
- Windows: `C:\Users\<User>\AppData\Local\yaq\yaqd-<kind>\Logs\<name>-<timestamp>.log`
## Accessing logs over RPC
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment