annotate Sphinx/source/faq/log.rst @ 368:6979ebaae833

merge
author Alain Mazy <alain@mazy.be>
date Wed, 01 Apr 2020 22:45:01 +0200
parents ecdd754e16ba 011b01ccf52d
children 0fb9369e893e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 .. _log:
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
126
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 124
diff changeset
3 Collecting logs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 124
diff changeset
4 ---------------
124
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
5
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
6 Standard logs
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
7 =============
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
8
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
9 Everytime the Orthanc service starts, it will generate
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
10 a new log file in ``C:\Program Files\Orthanc Server\Logs`` on Windows
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
11 and in ``/var/log/orthanc/`` on Linux.
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
12
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
13 By default, on Windows, if the Orthanc service fails to start, it will
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
14 retry to start 5 times and stop so it does not generate thousands of log files.
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15
124
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
16 Log files are named as ``Orthanc.log.YYYYMMDD-hhmmss.ffff`` including
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
17 the date/time when Orthanc was started.
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
18
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
19 Orthanc is not removing old logs so these log files might accumulate
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
20 and consume lot's of space. It's up to you to manage the logs folder
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
21 to make sure you don't fill your disk with logs.
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
22
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
23
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
24
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
25 Generating an exploitable debug log
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
26 ===================================
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
27
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
28 By default, Orthanc logs only the `WARNING` and `ERROR` level
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
29 logs. For your log to be exploitable by the Orthanc community, you must
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
30 generate them with the ``--verbose`` or ``--trace`` to get the `INFO`
cd0be128127d added info about standard logs
amazy
parents: 122
diff changeset
31 and `TRACE` information levels. If you are using
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 Orthanc at the command-line, simply add these flags and redirect the
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 standard outputs to some log file.
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 However, if you use packaged versions of Orthanc that runs the server
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 in background, you will have to manually start Orthanc. The sections
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 below explain how to achieve this goal with the officially supported
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 packages.
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 Under Windows
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 ^^^^^^^^^^^^^
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 Under Windows, if you used the official installer:
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 1. Download the `precompiled command-line version
358
011b01ccf52d fixing external hyperlinks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 336
diff changeset
47 <https://www.orthanc-server.com/download-windows.php>`__ of Orthanc.
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 2. Stop the Orthanc service. The actual process depends on your
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 version of Windows.
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
336
a5f7fc9fb611 Orthanc 1.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 290
diff changeset
52 3. Copy the just-downloaded ``Orthanc-1.6.0-Release.exe`` together
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 with your configuration file (that is by default located in
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 ``C:\Orthanc\Configuration.json``) into the same folder
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 (e.g. ``C:\Temp``).
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
233
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 220
diff changeset
57 4. In a command-line shell, manually start Orthanc to generate the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 220
diff changeset
58 ``Orthanc.log`` file::
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 $ cd C:\Temp
336
a5f7fc9fb611 Orthanc 1.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 290
diff changeset
61 $ Orthanc-1.6.0-Release.exe --verbose Configuration.json > Orthanc.log 2<&1
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
233
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 220
diff changeset
63 5. Once the log has been generated (by default, it is available as
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 220
diff changeset
64 ``C:\Temp\Orthanc.log``), stop Orthanc and possibly restart the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 220
diff changeset
65 Orthanc service.
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 Under Debian GNU/Linux
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 ^^^^^^^^^^^^^^^^^^^^^^
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 1. Stop the Orthanc service::
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 $ sudo /etc/init.d/orthanc stop
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 2. Manually start Orthanc (using the same configuration as the
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 service) and generate the log::
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 $ sudo -u orthanc /usr/sbin/Orthanc --verbose /etc/orthanc/ > Orthanc.log 2>&1
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 3. Restart the Orthanc service::
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 $ sudo /etc/init.d/orthanc start
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 Under Docker
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 ^^^^^^^^^^^^
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 The command-line to be used is::
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 $ sudo docker run -a stderr -p 4242:4242 -p 8042:8042 --rm jodogne/orthanc --verbose /etc/orthanc > Orthanc.log 2>&1
367
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
91
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
92 Change the log level while Orthanc is running
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
93 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
94
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
95 Starting from Orthanc 1.6.0, you can also change the log level while Orthanc is running through the Rest API::
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
96
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
97 $ curl -X PUT http://localhost:8042/tools/log-level -d "verbose"
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
98 $ curl -X PUT http://localhost:8042/tools/log-level -d "trace"
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
99 $ curl -X PUT http://localhost:8042/tools/log-level -d "default"
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
100