Package org.basex.server
Class Log
java.lang.Object
org.basex.server.Log
- All Implemented Interfaces:
QueryTracer
This class writes daily log files to disk.
The log format has been updated in Version 7.4; it now has the following columns:
- Time: timestamp (format:
xs:time) - Address: host name and port of the requesting client
- User: user name
- Type: Type of log message: REQUEST, OK or ERROR
- Info: Log message
- Performance: Measured time in milliseconds
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the log file.Returns a log file for the specified name (current or new instance).IOFile[]files()Returns all log files.booleanProcesses tracing output.voidwrite(Object type, String info, Performance perf, Context ctx) Writes an entry to the log file.voidwrite(Log.LogType type, String info, Performance perf, String address, Context ctx) Writes an entry to the log file.voidwrite(Log.LogType type, String info, Performance perf, Context ctx) Writes an entry to the log file.voidwriteServer(Log.LogType type, String info) Writes a server entry to the log file.
-
Field Details
-
SERVER
Server string.- See Also:
-
-
Constructor Details
-
Log
Constructor.- Parameters:
sopts- static options
-
-
Method Details
-
file
Returns a log file for the specified name (current or new instance).- Parameters:
name- name of log file- Returns:
- log file, or
nullif it does not exist
-
writeServer
Writes a server entry to the log file.- Parameters:
type- log typeinfo- info string (can benull)
-
write
Writes an entry to the log file.- Parameters:
type- typeinfo- info string (can benull)perf- performance object (can benull)ctx- database context
-
write
Writes an entry to the log file.- Parameters:
type- typeinfo- info string (can benull)perf- performance object (can benull)address- address (can benull)ctx- database context
-
write
Writes an entry to the log file.- Parameters:
type- type (Log.LogType, HTTP status code or custom string)info- info string (can benull)perf- performance object (can benull)ctx- database context
-
close
public void close()Closes the log file. -
files
Returns all log files.- Returns:
- log directory
-
print
Description copied from interface:QueryTracerProcesses tracing output.- Specified by:
printin interfaceQueryTracer- Parameters:
info- string to be output- Returns:
trueif string shall be further processed by the calling function
-