diff options
author | Bobby Rong <rjl931189261@126.com> | 2021-07-03 14:34:58 +0800 |
---|---|---|
committer | Bobby Rong <rjl931189261@126.com> | 2021-07-03 14:34:58 +0800 |
commit | e4ad7d6fc7047ba322aea64a846f7781129aa508 (patch) | |
tree | df4216261ff411b2897dc81b4139890198536c73 | |
parent | e63f523491e0bb757f66b91d5efb2d709612f4bd (diff) | |
download | nixpkgs-e4ad7d6fc7047ba322aea64a846f7781129aa508.tar nixpkgs-e4ad7d6fc7047ba322aea64a846f7781129aa508.tar.gz nixpkgs-e4ad7d6fc7047ba322aea64a846f7781129aa508.tar.bz2 nixpkgs-e4ad7d6fc7047ba322aea64a846f7781129aa508.tar.lz nixpkgs-e4ad7d6fc7047ba322aea64a846f7781129aa508.tar.xz nixpkgs-e4ad7d6fc7047ba322aea64a846f7781129aa508.tar.zst nixpkgs-e4ad7d6fc7047ba322aea64a846f7781129aa508.zip |
nixos: nixos/doc/manual/administration/logging.xml to CommonMark
-rw-r--r-- | nixos/doc/manual/administration/logging.chapter.md | 38 | ||||
-rw-r--r-- | nixos/doc/manual/administration/logging.xml | 43 | ||||
-rw-r--r-- | nixos/doc/manual/administration/running.xml | 2 | ||||
-rw-r--r-- | nixos/doc/manual/from_md/administration/logging.chapter.xml | 45 |
4 files changed, 84 insertions, 44 deletions
diff --git a/nixos/doc/manual/administration/logging.chapter.md b/nixos/doc/manual/administration/logging.chapter.md new file mode 100644 index 00000000000..4ce6f5e9fa7 --- /dev/null +++ b/nixos/doc/manual/administration/logging.chapter.md @@ -0,0 +1,38 @@ +# Logging {#sec-logging} + +System-wide logging is provided by systemd's *journal*, which subsumes +traditional logging daemons such as syslogd and klogd. Log entries are +kept in binary files in `/var/log/journal/`. The command `journalctl` +allows you to see the contents of the journal. For example, + +```ShellSession +$ journalctl -b +``` + +shows all journal entries since the last reboot. (The output of +`journalctl` is piped into `less` by default.) You can use various +options and match operators to restrict output to messages of interest. +For instance, to get all messages from PostgreSQL: + +```ShellSession +$ journalctl -u postgresql.service +-- Logs begin at Mon, 2013-01-07 13:28:01 CET, end at Tue, 2013-01-08 01:09:57 CET. -- +... +Jan 07 15:44:14 hagbard postgres[2681]: [2-1] LOG: database system is shut down +-- Reboot -- +Jan 07 15:45:10 hagbard postgres[2532]: [1-1] LOG: database system was shut down at 2013-01-07 15:44:14 CET +Jan 07 15:45:13 hagbard postgres[2500]: [1-1] LOG: database system is ready to accept connections +``` + +Or to get all messages since the last reboot that have at least a +"critical" severity level: + +```ShellSession +$ journalctl -b -p crit +Dec 17 21:08:06 mandark sudo[3673]: pam_unix(sudo:auth): auth could not identify password for [alice] +Dec 29 01:30:22 mandark kernel[6131]: [1053513.909444] CPU6: Core temperature above threshold, cpu clock throttled (total events = 1) +``` + +The system journal is readable by root and by users in the `wheel` and +`systemd-journal` groups. All users have a private journal that can be +read using `journalctl`. diff --git a/nixos/doc/manual/administration/logging.xml b/nixos/doc/manual/administration/logging.xml deleted file mode 100644 index da4877fcdf0..00000000000 --- a/nixos/doc/manual/administration/logging.xml +++ /dev/null @@ -1,43 +0,0 @@ -<chapter xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:xi="http://www.w3.org/2001/XInclude" - version="5.0" - xml:id="sec-logging"> - <title>Logging</title> - <para> - System-wide logging is provided by systemd’s <emphasis>journal</emphasis>, - which subsumes traditional logging daemons such as syslogd and klogd. Log - entries are kept in binary files in <filename>/var/log/journal/</filename>. - The command <literal>journalctl</literal> allows you to see the contents of - the journal. For example, -<screen> -<prompt>$ </prompt>journalctl -b -</screen> - shows all journal entries since the last reboot. (The output of - <command>journalctl</command> is piped into <command>less</command> by - default.) You can use various options and match operators to restrict output - to messages of interest. For instance, to get all messages from PostgreSQL: -<screen> -<prompt>$ </prompt>journalctl -u postgresql.service --- Logs begin at Mon, 2013-01-07 13:28:01 CET, end at Tue, 2013-01-08 01:09:57 CET. -- -... -Jan 07 15:44:14 hagbard postgres[2681]: [2-1] LOG: database system is shut down --- Reboot -- -Jan 07 15:45:10 hagbard postgres[2532]: [1-1] LOG: database system was shut down at 2013-01-07 15:44:14 CET -Jan 07 15:45:13 hagbard postgres[2500]: [1-1] LOG: database system is ready to accept connections -</screen> - Or to get all messages since the last reboot that have at least a - “critical” severity level: -<screen> -<prompt>$ </prompt>journalctl -b -p crit -Dec 17 21:08:06 mandark sudo[3673]: pam_unix(sudo:auth): auth could not identify password for [alice] -Dec 29 01:30:22 mandark kernel[6131]: [1053513.909444] CPU6: Core temperature above threshold, cpu clock throttled (total events = 1) -</screen> - </para> - <para> - The system journal is readable by root and by users in the - <literal>wheel</literal> and <literal>systemd-journal</literal> groups. All - users have a private journal that can be read using - <command>journalctl</command>. - </para> -</chapter> diff --git a/nixos/doc/manual/administration/running.xml b/nixos/doc/manual/administration/running.xml index 43642b659a8..aeccc843792 100644 --- a/nixos/doc/manual/administration/running.xml +++ b/nixos/doc/manual/administration/running.xml @@ -14,7 +14,7 @@ <xi:include href="../from_md/administration/rebooting.chapter.xml" /> <xi:include href="../from_md/administration/user-sessions.chapter.xml" /> <xi:include href="../from_md/administration/control-groups.chapter.xml" /> - <xi:include href="logging.xml" /> + <xi:include href="../from_md/administration/logging.chapter.xml" /> <xi:include href="cleaning-store.xml" /> <xi:include href="containers.xml" /> <xi:include href="troubleshooting.xml" /> diff --git a/nixos/doc/manual/from_md/administration/logging.chapter.xml b/nixos/doc/manual/from_md/administration/logging.chapter.xml new file mode 100644 index 00000000000..4da38c065a2 --- /dev/null +++ b/nixos/doc/manual/from_md/administration/logging.chapter.xml @@ -0,0 +1,45 @@ +<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-logging"> + <title>Logging</title> + <para> + System-wide logging is provided by systemd’s + <emphasis>journal</emphasis>, which subsumes traditional logging + daemons such as syslogd and klogd. Log entries are kept in binary + files in <literal>/var/log/journal/</literal>. The command + <literal>journalctl</literal> allows you to see the contents of the + journal. For example, + </para> + <programlisting> +$ journalctl -b +</programlisting> + <para> + shows all journal entries since the last reboot. (The output of + <literal>journalctl</literal> is piped into <literal>less</literal> + by default.) You can use various options and match operators to + restrict output to messages of interest. For instance, to get all + messages from PostgreSQL: + </para> + <programlisting> +$ journalctl -u postgresql.service +-- Logs begin at Mon, 2013-01-07 13:28:01 CET, end at Tue, 2013-01-08 01:09:57 CET. -- +... +Jan 07 15:44:14 hagbard postgres[2681]: [2-1] LOG: database system is shut down +-- Reboot -- +Jan 07 15:45:10 hagbard postgres[2532]: [1-1] LOG: database system was shut down at 2013-01-07 15:44:14 CET +Jan 07 15:45:13 hagbard postgres[2500]: [1-1] LOG: database system is ready to accept connections +</programlisting> + <para> + Or to get all messages since the last reboot that have at least a + <quote>critical</quote> severity level: + </para> + <programlisting> +$ journalctl -b -p crit +Dec 17 21:08:06 mandark sudo[3673]: pam_unix(sudo:auth): auth could not identify password for [alice] +Dec 29 01:30:22 mandark kernel[6131]: [1053513.909444] CPU6: Core temperature above threshold, cpu clock throttled (total events = 1) +</programlisting> + <para> + The system journal is readable by root and by users in the + <literal>wheel</literal> and <literal>systemd-journal</literal> + groups. All users have a private journal that can be read using + <literal>journalctl</literal>. + </para> +</chapter> |