- OrientDB - Console Modes
- OrientDB - Data Types
- OrientDB - Basic Concepts
- OrientDB - Installation
- OrientDB - Overview
- OrientDB - Home
OrientDB Database Commands
- OrientDB - Drop Database
- OrientDB - Optimize Database
- OrientDB - Rollback Database
- OrientDB - Commit Database
- OrientDB - Import Database
- OrientDB - Export Database
- OrientDB - Config Database
- OrientDB - Release Database
- OrientDB - Freeze Database
- OrientDB - List Database
- OrientDB - Info Database
- OrientDB - Disconnect Database
- OrientDB - Connect Database
- OrientDB - Restore Database
- OrientDB - Backup Database
- OrientDB - Alter Database
- OrientDB - Create Database
OrientDB Record Commands
- OrientDB - Delete Record
- OrientDB - Truncate Record
- OrientDB - Update Record
- OrientDB - Export Record
- OrientDB - Reload Record
- OrientDB - Load Record
- OrientDB - Display Records
- OrientDB - Insert Record
OrientDB Class Commands
OrientDB Cluster Commands
- OrientDB - Drop Cluster
- OrientDB - Truncate Cluster
- OrientDB - Alter Cluster
- OrientDB - Create Cluster
OrientDB Property Commands
OrientDB Vertex Commands
OrientDB Edge Commands
OrientDB Advanced Concepts
- OrientDB - Studio
- OrientDB - Security
- OrientDB - Upgrading
- OrientDB - Performance Tuning
- OrientDB - Logging
- OrientDB - Caching
- OrientDB - Hooks
- OrientDB - Transactions
- OrientDB - Indexes
- OrientDB - Sequences
- OrientDB - Functions
OrientDB Interfaces
OrientDB Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
OrientDB - Logging
OrientDB uses the Java Logging framework bundled with Java Virtual Machine. OrientDB s default log format is managed by OLogFormatter class.
The following statement is the basic syntax of logging command.
<date> <level> <message> [<requester>]
Following are the details about the options in the above syntax.
<date> − It is the log date in the following format: yyyy-MM-dd HH:mm:ss:SSS.
<level> − It is the logging level as 5 chars output.
<message> − It is the text of log, it can be of any size.
[<class>] − It is the Java class that is logged (optional).
Supported levels are those contained in the JRE class java.util.logging.Level. They are −
SEVERE (highest value)
WARNING
INFO
CONFIG
FINE
FINER
FINEST (lowest value)
By default, two loggers are installed −
Console, as the output of the shell/command prompt that starts the apppcation/server. Can be changed by setting the variable ‘log.console.level’.
File, as the output to the log files. Can be changed by setting the ‘log.file.level’.
Configure Logging
The logging strategies and popcies can be configured using a file following the Java.
syntax − Java Logging configuration.
Example
Copy the following content from orientdb-server-log.properties file and put it in the $ORIENTDB_HOME/config file.
# Specify the handlers to create in the root logger # (all loggers are children of the root logger) # The following creates two handlers handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler # Set the default logging level for the root logger .level = ALL # Set the default logging level for new ConsoleHandler instances java.util.logging.ConsoleHandler.level = INFO # Set the default formatter for new ConsoleHandler instances java.util.logging.ConsoleHandler.formatter = com.orientechnologies.common.log.OLogFormatter # Set the default logging level for new FileHandler instances java.util.logging.FileHandler.level = INFO # Naming style for the output file java.util.logging.FileHandler.pattern =../log/orient-server.log # Set the default formatter for new FileHandler instances java.util.logging.FileHandler.formatter = com.orientechnologies.common.log.OLogFormatter # Limiting size of output file in bytes: java.util.logging.FileHandler.pmit = 10000000 # Number of output files to cycle through, by appending an # integer to the base file name: java.util.logging.FileHandler.count = 10
To tell the JVM where the properties file is placed, you need to set the "java.util.logging.config.file" system property to it. For example, use the following command −
$ java -Djava.util.logging.config.file=mylog.properties ...
Set the logging level
To change the logging level without modifying the logging configuration, just set the "log.console.level" and "log.file.level" system variables to the requested levels.
Logging at Startup
Following are the procedures to set logging at startup level in different ways.
In the Server Configuration
Open the file orientdb-server-config.xml and add or update these pnes at the end of the file inside the <properties> section −
<entry value = "fine" name = "log.console.level" /> <entry value = "fine" name = "log.file.level" />
In Server.sh (or .bat) Script
Set the system property "log.console.level" and "log.file.level" to the levels you want using the -D parameter of java.
$ java -Dlog.console.level = FINE ...
Logging at Run-time
Following are the procedures to set logging at startup level in different ways.
By Using Java Code
The system variable can be set at startup using the System.setProperty() API. The following code snippet is the syntax to set logging level using Java code.
pubpc void main(String[] args){ System.setProperty("log.console.level", "FINE"); ... }
On Remote Server
Execute a HTTP POST against the URL: /server/log.<type>/<level>, where −
<type> can be "console" or "file"
<level> is one of the supported levels
Example
The following example uses cURL to execute a HTTP POST command against OrientDB Server. Server s "root" user and password were used, replace with your own password.
Enable the finest tracing level to console −
curl -u root:root -X POST http://localhost:2480/server/log.console/FINEST
Enable the finest tracing level to file −
curl -u root:root -X POST http://localhost:2480/server/log.file/FINESTAdvertisements