annotate Sphinx/source/faq/log.rst @ 1113:a588960a72e5 default tip

spelling
author Alain Mazy <am@orthanc.team>
date Mon, 28 Oct 2024 09:23:08 +0100
parents f049d19e3109
children
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
538
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
28 .. highlight:: bash
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
29
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
30 By default, the Orthanc logs contain only the ``WARNING`` and
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
31 ``ERROR`` information levels. For your logs to be exploitable by the
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
32 Orthanc community, you must include more information by adding the
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
33 ``--verbose`` or ``--trace`` command-line options, which will add the
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
34 ``INFO`` and ``TRACE`` information levels. If you are starting Orthanc
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
35 from the command-line, simply add these flags and redirect the
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
36 standard outputs to some log file. For instance::
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
538
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
38 $ ./Orthanc --trace --logfile=orthanc.log
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
39
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
40 Note that the Orthanc command-line tool has many other options related
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
41 to logging. Check out the :ref:`full manpage <manpage>`.
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
42
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
43 However, if you use packaged versions of Orthanc that starts the
1004
17bf6fafb884 added links to uclouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 996
diff changeset
44 server in background (such as GNU/Linux packages or the `Windows
17bf6fafb884 added links to uclouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 996
diff changeset
45 installers <https://www.orthanc-server.com/download-windows.php>`__),
17bf6fafb884 added links to uclouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 996
diff changeset
46 you will have to manually start Orthanc. The sections below explain
17bf6fafb884 added links to uclouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 996
diff changeset
47 how to achieve this goal with the officially supported packages.
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
886
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
50 With Orthanc Explorer 2 installed
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
51 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
52
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
53 If you have the :ref:`Orthanc Explorer 2 plugin <orthanc-explorer-2>`
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
54 enabled, open the settings pane at `http://localhost:8042/ui/app/#/settings
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
55 <http://localhost:8042/ui/app/#/settings>`__ and change the verbose level
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
56 from there without restarting Orthanc:
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
57
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
58
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
59 .. image:: ../images/OE2-settings-logs.png
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
60 :align: center
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
61 :width: 800px
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
62
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
63
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
64
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 Under Windows
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
886
bca261dac7bb logs with OE2
Alain Mazy <am@osimis.io>
parents: 810
diff changeset
68
1064
f049d19e3109 verbose Windows service
Alain Mazy <am@orthanc.team>
parents: 1023
diff changeset
69 If you used the `official Windows installers
1004
17bf6fafb884 added links to uclouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 996
diff changeset
70 <https://www.orthanc-server.com/download-windows.php>`__:
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
809
23f21a00b03b updated collect log procedure for windows
Alain Mazy <am@osimis.io>
parents: 638
diff changeset
72 1. Stop the Orthanc service. The actual process depends on your
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 version of Windows.
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
809
23f21a00b03b updated collect log procedure for windows
Alain Mazy <am@osimis.io>
parents: 638
diff changeset
75 2. Make sure you have a ``C:\Temp`` folder available to store the log file.
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
809
23f21a00b03b updated collect log procedure for windows
Alain Mazy <am@osimis.io>
parents: 638
diff changeset
77 3. In a command-line shell, manually start Orthanc to generate the
233
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 220
diff changeset
78 ``Orthanc.log`` file::
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
809
23f21a00b03b updated collect log procedure for windows
Alain Mazy <am@osimis.io>
parents: 638
diff changeset
80 $ "C:\Program Files\Orthanc Server\Orthanc.exe" --verbose "C:\Program Files\Orthanc Server\Configuration" > C:\Temp\Orthanc.log 2<&1
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
809
23f21a00b03b updated collect log procedure for windows
Alain Mazy <am@osimis.io>
parents: 638
diff changeset
82 This will start Orthanc with exactly the same configuration as your service,
23f21a00b03b updated collect log procedure for windows
Alain Mazy <am@osimis.io>
parents: 638
diff changeset
83 but in verbose mode.
23f21a00b03b updated collect log procedure for windows
Alain Mazy <am@osimis.io>
parents: 638
diff changeset
84
23f21a00b03b updated collect log procedure for windows
Alain Mazy <am@osimis.io>
parents: 638
diff changeset
85 4. Once the log has been generated (in ``C:\Temp\Orthanc.log``), stop Orthanc
23f21a00b03b updated collect log procedure for windows
Alain Mazy <am@osimis.io>
parents: 638
diff changeset
86 and possibly restart the Orthanc service.
23
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
1064
f049d19e3109 verbose Windows service
Alain Mazy <am@orthanc.team>
parents: 1023
diff changeset
89 By default, the Orthanc service will always start in the default ``Warning`` log level.
f049d19e3109 verbose Windows service
Alain Mazy <am@orthanc.team>
parents: 1023
diff changeset
90 If you want to make it start in ``Verbose`` mode at every start, you should set this Registry
f049d19e3109 verbose Windows service
Alain Mazy <am@orthanc.team>
parents: 1023
diff changeset
91 Key to 1::
f049d19e3109 verbose Windows service
Alain Mazy <am@orthanc.team>
parents: 1023
diff changeset
92
f049d19e3109 verbose Windows service
Alain Mazy <am@orthanc.team>
parents: 1023
diff changeset
93 Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Orthanc\Orthanc Server\Verbose
f049d19e3109 verbose Windows service
Alain Mazy <am@orthanc.team>
parents: 1023
diff changeset
94
f049d19e3109 verbose Windows service
Alain Mazy <am@orthanc.team>
parents: 1023
diff changeset
95
f049d19e3109 verbose Windows service
Alain Mazy <am@orthanc.team>
parents: 1023
diff changeset
96
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 Under Debian GNU/Linux
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 ^^^^^^^^^^^^^^^^^^^^^^
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 1. Stop the Orthanc service::
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 $ sudo /etc/init.d/orthanc stop
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 2. Manually start Orthanc (using the same configuration as the
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 service) and generate the log::
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 $ 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
108
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 3. Restart the Orthanc service::
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 $ sudo /etc/init.d/orthanc start
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 Under Docker
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 ^^^^^^^^^^^^
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116
1023
5d4701d8fe28 replaced osimis/orthanc by orthancteam/orthanc
Alain Mazy <am@osimis.io>
parents: 1015
diff changeset
117 With ``orthancteam/orthanc`` images, simply define the ``VERBOSE_ENABLED`` environment
1015
f263cd65a754 docker logs
Alain Mazy <am@osimis.io>
parents: 1004
diff changeset
118 variable to ``true`` when starting your container and then, run this command to
f263cd65a754 docker logs
Alain Mazy <am@osimis.io>
parents: 1004
diff changeset
119 retrieve the logs in a file::
f263cd65a754 docker logs
Alain Mazy <am@osimis.io>
parents: 1004
diff changeset
120
f263cd65a754 docker logs
Alain Mazy <am@osimis.io>
parents: 1004
diff changeset
121 $ sudo docker logs your_container_name &> /tmp/orthanc.log
f263cd65a754 docker logs
Alain Mazy <am@osimis.io>
parents: 1004
diff changeset
122
f263cd65a754 docker logs
Alain Mazy <am@osimis.io>
parents: 1004
diff changeset
123
f263cd65a754 docker logs
Alain Mazy <am@osimis.io>
parents: 1004
diff changeset
124 With ``jodogne/orthanc`` images, use this command line::
23
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125
f99aa6a6f0c9 Generating an Exploitable Log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 $ 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
127
538
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
128
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
129 Changing the log level while Orthanc is running
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
130 ===============================================
367
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
131
538
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
132 Starting with Orthanc 1.6.0, you can dynamically change the log level
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
133 while Orthanc is running using the :ref:`REST API <rest>`::
367
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
134
ecdd754e16ba Rest API to change log-level
Alain Mazy <alain@mazy.be>
parents: 336
diff changeset
135 $ 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
136 $ 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
137 $ 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
138
538
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
139
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
140 Log categories
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
141 ==============
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
142
568
090cc988c35e Orthanc 1.8.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 554
diff changeset
143 Starting with Orthanc 1.8.2, log messages are associated with a
538
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
144 **category**. The category indicates the subsystem of Orthanc from
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
145 which the message comes (such as the embedded HTTP server, the DICOM
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
146 communications, Lua scripts...).
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
147
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
148 It is possible to choose a different log level for each category. This
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
149 can be done when starting Orthanc as follows::
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
150
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
151 $ ./Orthanc --verbose-http --trace-dicom
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
152
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
153 This command would start Orthanc in verbose mode for HTTP-related
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
154 messages, and would enable debug messages related to DICOM. The full
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
155 list of the available log categories (``http``, ``dicom``, ``lua``,
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
156 ``plugins``...) can be found in the :ref:`manpage of Orthanc
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
157 <manpage>` or by starting Orthanc with the ``--help`` flag.
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
158
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
159 It is also possible to dynamically change the log level of a category
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
160 while Orthanc is running by using the :ref:`REST API <rest>`, for
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
161 instance::
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
162
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
163 $ curl -X PUT http://localhost:8042/tools/log-level-http -d "verbose"
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
164 $ curl -X PUT http://localhost:8042/tools/log-level-dicom -d "trace"
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
165 $ curl -X PUT http://localhost:8042/tools/log-level-plugins -d "default"
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
166
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
167 The list of the available log categories is also available through the
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
168 REST API, by inspecting the URIs that are prefixed by
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
169 ``/tools/log-level``::
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
170
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
171 $ curl http://localhost:8042/tools/
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
172 [...]
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
173 "log-level",
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
174 "log-level-dicom",
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
175 "log-level-generic",
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
176 "log-level-http",
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
177 "log-level-jobs",
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
178 [...]
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
179
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
180 **Remarks:**
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
181
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
182 * Messages that are not associated with a well-identified category are
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
183 considered as belonging to the ``generic`` category.
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
184
996
d43d74afdfad logs-no-thread
Alain Mazy <am@osimis.io>
parents: 896
diff changeset
185 * Using the ``--verbose`` or ``--trace`` command-line options, or
538
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
186 changing the value of the ``/tools/log-level`` URI will reset the
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
187 log level of **all** the categories. Note that the command-line
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
188 options are applied from left to right.
d18496f166b8 documenting the log categories, and manpage of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 528
diff changeset
189
896
Alain Mazy <am@osimis.io>
parents: 886
diff changeset
190 * Provided that you have left the ``DeidentifyLogs`` configuration to
Alain Mazy <am@osimis.io>
parents: 886
diff changeset
191 its ``true`` default value, Orthanc logs will not contain any sensitive
996
d43d74afdfad logs-no-thread
Alain Mazy <am@osimis.io>
parents: 896
diff changeset
192 patient information.
d43d74afdfad logs-no-thread
Alain Mazy <am@osimis.io>
parents: 896
diff changeset
193
d43d74afdfad logs-no-thread
Alain Mazy <am@osimis.io>
parents: 896
diff changeset
194 * Starting from Orthanc 1.12.2, Orthanc is logging the thread name in the
d43d74afdfad logs-no-thread
Alain Mazy <am@osimis.io>
parents: 896
diff changeset
195 logs. If you need to revert back to the previous format, add the
1004
17bf6fafb884 added links to uclouvain
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 996
diff changeset
196 ``--logs-no-thread`` command line option at startup.