wolfssl: Update to v4.6.0-stable
[librecmc/librecmc.git] / docs / System_Log.md
1 # System Log
2
3 ## Viewing the system log from LuCi
4
5 Select the `Status >> System Log` menu entry.
6
7 ![alt text](images/librecmc-luci-selecting-system-log.png "Selecting
8  the System Log page in LuCi")
9
10 ![alt text](images/librecmc-luci-system-log.png "The System Log page
11  in LuCi")
12
13 The `System Log` page in LuCi does not have an interface for filtering
14 output. Therefore, you will likely want to use the shell interface.
15
16 ## Viewing the system log from the shell
17
18 Once logged in via SSH, use the `logread` command
19
20 ```bash
21 Usage: logread [options]
22 Options:
23     -s <path>           Path to ubus socket
24     -l  <count>         Got only the last 'count' messages
25     -e  <pattern>       Filter messages with a regexp
26     -r  <server> <port> Stream message to a server
27     -F  <file>          Log file
28     -S  <bytes>         Log size
29     -p  <file>          PID file
30     -h  <hostname>      Add hostname to the message
31     -P  <prefix>        Prefix custom text to streamed messages
32     -f                  Follow log messages
33     -u                  Use UDP as the protocol
34     -t                  Add an extra timestamp
35     -0                  Use \0 instead of \n as trailer when using TCP
36 ```
37
38 For example:
39
40 ```bash
41 root@libreCMC:~$ logread | grep 'kern\.warn'
42 Mon Jan 15 20:22:01 2018 kern.warn kernel: [    0.000000] No valid device tree found, continuing without
43 Mon Jan 15 20:22:01 2018 kern.warn kernel: [    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
44 Mon Jan 15 20:22:01 2018 kern.warn kernel: [    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
45 Mon Jan 15 20:22:01 2018 kern.warn kernel: [    0.669305] Crashlog allocated RAM at address 0x3f00000
46 Mon Jan 15 20:22:01 2018 kern.warn kernel: [    0.752178] m25p80 spi0.0: found mx25l12805d, expected m25p80
47 ```
48
49 One should be able to use `logread -e` instead of `grep`, but it seems
50 that not all the same regular expressions work for both:
51
52 ```bash
53 root@libreCMC:~$ logread -e 'kern\.warn' # and other similar variations
54 (no output)
55 ```
56
57 The system log is contained in a limited size, circular buffer in
58 memory. So, if you have some process writing messages periodically,
59 this will eventually erase messages that were only written once.
60
61 ## Configuring the system log
62
63 TODO
64
65 ## Monitoring the system log
66
67 TODO