Mercurial > hg > orthanc-book
annotate Sphinx/source/faq/log.rst @ 392:0fb9369e893e
Orthanc 1.6.1
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 21 Apr 2020 15:22:20 +0200 |
parents | 6979ebaae833 |
children | c95817c254fe |
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 | 3 Collecting logs |
4 --------------- | |
124 | 5 |
6 Standard logs | |
7 ============= | |
8 | |
9 Everytime the Orthanc service starts, it will generate | |
10 a new log file in ``C:\Program Files\Orthanc Server\Logs`` on Windows | |
11 and in ``/var/log/orthanc/`` on Linux. | |
12 | |
13 By default, on Windows, if the Orthanc service fails to start, it will | |
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 | 16 Log files are named as ``Orthanc.log.YYYYMMDD-hhmmss.ffff`` including |
17 the date/time when Orthanc was started. | |
18 | |
19 Orthanc is not removing old logs so these log files might accumulate | |
20 and consume lot's of space. It's up to you to manage the logs folder | |
21 to make sure you don't fill your disk with logs. | |
22 | |
23 | |
24 | |
25 Generating an exploitable debug log | |
26 =================================== | |
27 | |
28 By default, Orthanc logs only the `WARNING` and `ERROR` level | |
29 logs. For your log to be exploitable by the Orthanc community, you must | |
30 generate them with the ``--verbose`` or ``--trace`` to get the `INFO` | |
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 |
392 | 52 3. Copy the just-downloaded ``Orthanc-1.6.1-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 | 57 4. In a command-line shell, manually start Orthanc to generate the |
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 |
392 | 61 $ Orthanc-1.6.1-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 | 63 5. Once the log has been generated (by default, it is available as |
64 ``C:\Temp\Orthanc.log``), stop Orthanc and possibly restart the | |
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 | 91 |
92 Change the log level while Orthanc is running | |
93 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
94 | |
95 Starting from Orthanc 1.6.0, you can also change the log level while Orthanc is running through the Rest API:: | |
96 | |
97 $ curl -X PUT http://localhost:8042/tools/log-level -d "verbose" | |
98 $ curl -X PUT http://localhost:8042/tools/log-level -d "trace" | |
99 $ curl -X PUT http://localhost:8042/tools/log-level -d "default" | |
100 |