|
1 |
| -``acrnlog`` |
2 |
| -=========== |
| 1 | +.. _acrnlog: |
3 | 2 |
|
4 |
| -DESCRIPTION |
5 |
| -########### |
6 |
| -``acrnlog`` is a userland tool to capture ACRN hypervisor log, it runs as an |
7 |
| -SOS service at boot. It captures two kinds of logs: |
| 3 | +acrnlog |
| 4 | +####### |
8 | 5 |
|
9 |
| -- log of current running; |
| 6 | +Description |
| 7 | +*********** |
10 | 8 |
|
11 |
| -- log of last running if crashed and logs remaining. |
| 9 | +``acrnlog`` is a userland tool used to capture a ACRN hypervisor log. It runs as an |
| 10 | +SOS service at boot, capturing two kinds of logs: |
12 | 11 |
|
13 |
| -The path to save log files is ``/tmp/acrnog/``, so the log files would be lost |
14 |
| -after reset. |
| 12 | +- log of the currently running hypervisor |
| 13 | +- log of last running hypervisor if it crashed and the logs remain. |
15 | 14 |
|
16 |
| -USAGE |
17 |
| -##### |
18 |
| -The ``acrnlog`` tool is launched as a service at boot, with 4 1MB log files limited. |
19 |
| -To change the log file limitation: |
| 15 | +Log files are saved in ``/tmp/acrnlog/``, so the log files would be lost |
| 16 | +after a system reset. |
20 | 17 |
|
21 |
| -- temporary change: |
22 |
| - Stop the ``acrnlog`` service: |
| 18 | +Usage |
| 19 | +***** |
23 | 20 |
|
24 |
| - :: |
| 21 | +The ``acrnlog`` tool is launched as a service at boot, and limited to |
| 22 | +supporting four 1MB log files by default. You can change this log file |
| 23 | +limitation temporarily or permanently. |
25 | 24 |
|
26 |
| - # systemctl disable acrnlog |
27 | 25 |
|
28 |
| -Restart ``acrnlog`` running in backgroud with size and number of files. |
29 |
| - For example: |
| 26 | +Temporary log file changes |
| 27 | +========================== |
30 | 28 |
|
31 |
| - :: |
| 29 | +You can temporarily change the log file setting by following these |
| 30 | +steps: |
32 | 31 |
|
33 |
| - # acrnlog -n 8 -s 4 & |
| 32 | +1. Stop the ``acrnlog`` service: |
34 | 33 |
|
35 |
| -Use ``get_loglevel``/``set_loglevel`` to query and change the hypervisor loglevel. |
| 34 | + .. code-block:: none |
36 | 35 |
|
37 |
| -The ``mem_loglevel`` controls log to be saved using ``acrnlog``, while |
38 |
| -``console_loglevel`` controls log to output to console. For example: |
| 36 | + # systemctl disable acrnlog |
39 | 37 |
|
40 |
| - :: |
| 38 | +2. Restart ``acrnlog``, running in the background, and specify the new |
| 39 | + number of log files and their size (in MB). For example: |
41 | 40 |
|
42 |
| - ACRN:\>get_loglevel |
43 |
| - console_loglevel: 2, mem_loglevel: 4 |
44 |
| - ACRN:\>set_loglevel 2 5 |
45 |
| - ACRN:\>get_loglevel |
46 |
| - console_loglevel: 2, mem_loglevel: 5 |
| 41 | + .. code-block:: none |
47 | 42 |
|
48 |
| -- permanent change: |
49 |
| - Edit ``/usr/lib/systemd/system/acrnlog.service`` to attached the ``-n`` and ``-s`` options to the ``ExecStart`` cmd, and restart the service. For example: |
| 43 | + # acrnlog -n 8 -s 4 & |
50 | 44 |
|
51 |
| - :: |
| 45 | +You can use ``get_loglevel`` and ``set_loglevel`` to query and change |
| 46 | +the hypervisor loglevel. |
52 | 47 |
|
53 |
| - ExecStart=/usr/bin/acrnlog -n 8 -s 4 |
| 48 | +The ``mem_loglevel`` command controls the log to be saved using |
| 49 | +``acrnlog``, while the ``console_loglevel`` command controls the log |
| 50 | +output to the console. For example: |
54 | 51 |
|
| 52 | +.. code-block:: none |
55 | 53 |
|
56 |
| -BUILD & INSTALL |
57 |
| -################## |
| 54 | + ACRN:\>get_loglevel |
| 55 | + console_loglevel: 2, mem_loglevel: 4 |
| 56 | + ACRN:\>set_loglevel 2 5 |
| 57 | + ACRN:\>get_loglevel |
| 58 | + console_loglevel: 2, mem_loglevel: 5 |
58 | 59 |
|
59 |
| -:: |
| 60 | +Permanent log file changes |
| 61 | +========================== |
60 | 62 |
|
61 |
| - # make |
62 |
| - |
63 |
| -copy acrnlog to ``/usr/bin/`` and copy ``acrnlog.service`` to ``/usr/lib/systemd/system/`` |
| 63 | +You can also permanently change the log file settings by |
| 64 | +editing ``/usr/lib/systemd/system/acrnlog.service`` and use the ``-n`` |
| 65 | +and ``-s`` options on the ``ExecStart`` cmd, and restart the service. |
| 66 | +For example, ``acrnlog.service`` could have these parameters added: |
| 67 | + |
| 68 | +.. code-block:: none |
| 69 | +
|
| 70 | + ExecStart=/usr/bin/acrnlog -n 8 -s 4 |
| 71 | +
|
| 72 | +and then restart the service with: |
| 73 | + |
| 74 | +.. code-block:: none |
| 75 | +
|
| 76 | + # systemctl daemon-reload |
| 77 | + # systemctl restart acrnlog |
| 78 | +
|
| 79 | +Build and Install |
| 80 | +***************** |
| 81 | + |
| 82 | +Source code for the ``acrnlog`` tools is in the ``tools/acrnlog`` |
| 83 | +folder. Build and install the tools from source using: |
| 84 | + |
| 85 | +.. code-block:: none |
| 86 | +
|
| 87 | + # make |
| 88 | + # make install |
| 89 | +
|
| 90 | +and if you changed the ``acrnlog.service`` file, install it using: |
| 91 | + |
| 92 | +.. code-block:: none |
| 93 | +
|
| 94 | + # cp acrnlog.service /usr/lib/systemd/system/ |
0 commit comments