Changes

Jump to navigation Jump to search
1,011 bytes added ,  18:43, 24 January 2017
The server logs can e.g. be used to get an overview of all processes executed on your server, trace any errors
or compile performance statistics.
 
==Introduction==
The server logs 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 according date. Note that, depending on your OS and configuration, files and folders beinning with a <code>.</code> may be hidden. The log directory can be changed via the {{Option|LOGPATH}} option.
* The maximum length of logging messages can be changed via [[Options#LOGMSGMAXLEN|LOGMSGMAXLEN]].
* The [[Admin Module]] provides access to the log files from XQuery.
 
==RESTXQ==
 
{{Mark|Introduced with 8.6:}}
 
Non-trivial web applications provide the ability for users to sign in and out. User handling can be realized with session attributes (see e. g. the [[DBA]] code).
 
By default, RESTXQ code is run with admin permissions. However, as it is more interesting to know which user has called a function, the RESTXQ user string (which is {{Code|admin}} by default, and which will show up in the log data) will be overwritten by the value of an {{Code|id}} session attribute. If the request path includes {{Code|/dba/}}, the {{Code|dba}} session attribute will be assigned.
 
If the following function is called more than once, {{Code|joe}} will appear as user in the second and subsequent log entries:
 
<pre class="brush:xquery">
import module namespace Session = 'http://basex.org/modules/session';
declare %rest:path('/session-id') function local:f() {
Session:set('id', 'joe'),
'I am Joe'
};
</pre>
==Format==
;Version 8.6
* Added: The log directory can be changed with the {{Option|LOGPATH}} option.
* Updated: Include session attributes in log data.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu