Changes

Jump to navigation Jump to search
340 bytes added ,  01:38, 25 August 2012
no edit summary
This article is part of the [[Advanced User's Guide]].It describes how client operations are logged by the server.The server logs can e.g. be used to get an overview of all processes executed on your server, trace any errorsor compile performance statistics.
The server logs give are written in plain text.In your [[Configuration#Database Directory|Database Directory]], you can find a folder named <code>.logs</code> in which all log files are stored with the following advantages:according date. Note that, depending on your OS and configuration, files and folders beinning with a <code>.</code> may be hidden.
* Overview about all processes executed on your server* Tracing of any errors thrown by BaseX* Tracing of wrong modified data* Tracing of all specific user processes* Tracing of time specific processesSome changes have been introduced with {{Version|7.4}}:
* The server logs logging format has been revised.* HTTP requests are written now included in plain-text and the log files.* Logging can be opened with any editorturned on/off via the [[Options#LOG|LOG]] option.In your * The maximum length of logging messages can be changed via [[ConfigurationOptions#Database DirectoryLOGMSGMAXLEN|Database DirectoryLOGMSGMAXLEN]], you can find a folder named <code>.logs</code> in which all * An [[Admin Module]] provides access to the log files are stored with the according date. Note that, depending on your OS and configuration, files and folders with a '.' prefix may be hiddenfrom XQuery.
Since {{Version|7.4}}, HTTP requests will also be stored in the log files, logging can be turned on/off via the [[Options#LOG|LOG]] option, and the maximum length of logging messages can be changed via [[Options#LOGMSGMAXLEN|LOGMSGMAXLEN]].==Format==
==Logformat==; Example 1:
;Example:: <pre>1601:18:12.892 SERVER admin OK Server was started.01:0018:0015.094 [436 127.0.0.1:3920] LOGIN admin OK &#10;164722 jack REQUEST XQUERY for $i in 1 to 5 return random:double()01:0018:0015.104 [446 127.0.0.1:3920] XQUERY 1 to 10 4722 jack OK 12 Query executed in 2.38 ms. 2.36 72 ms&#10;1601:0018:0015.114 [447 127.0.0.1:3920] LOGOUT admin OK</pre>4722 jack REQUEST EXIT01: Now you can see the 'admin' user has the IP 18:15.447 127.0.0.1 with the socketport 3920. With this information you can identify each transaction of the corresponding user:4722 jack OK 0.39 ms</pre>
A server has been started and a user <code>jack</code> has connected to the server to perform a query and exit properly. ;Example2:: <pre>1001:0623:3633.498 [251 127.0.0.1:499904736 john OK QUERY[0] LOGIN admin OK&#10;10'hi' 0.44 ms01:0623:5333.297 [337 127.0.0.1:499904736 john OK ITER[0] XQUERY 1 to 10 OK 17.89 14 ms&#10;1001:0723:0333.353 [338 127.0.0.1:499934736 john OK INFO[0] LOGIN testuser OK&#10;10 0.36 ms01:0723:0833.259 [339 127.0.0.1:49993] XQUERY 1 to z Error: Stopped at line 1, column 6: 4736 john OK CLOSE[XPDY00020] No context item set for 'z' 0. 9.69 21 ms&#10;1001:0723:1533.505 [359 127.0.0.1:49990] LOGOUT admin OK&#10;104736 john REQUEST EXIT01:0723:1933.790 [359 127.0.0.1:49993] LOGOUT testuser 4736 john OK 20.14 ms</pre>: Now you can see the 'admin' A user <code>john</code> has performed an iterative query, using one of the IP client APIs. ; Example 3: <pre>01:31:51.888 127.0.0.1 with the socketport 49990 and the 'testuser' has the IP :4803 admin REQUEST [GET] http://localhost:8984/rest/factbook01:31:51.892 127.0.0.1 with the socketport 49993:4803 admin 200 4. With this information you can identify each transaction of 43 ms</pre> An admin user has requested the corresponding user. The 'testuser' for example executed a query which was aborted by a syntax error<code>factbook</code> database via REST.
[[Category:Server]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu