MprLog
Module | ejs |
Definition | class MprLog |
Inheritance | MprLog Object |
Specified | ejscript-2.5 |
Stability | Prototype. |
The MprLog class manages the Application's internal MPR log mechanism.
If the Application was started with a
"--log" command line switch, the application will write log messages to the specified file, otherwise
messages will be sent to the standard error console. The Application will have a single instance of the
MprLog class created and stored in the App.mprLog property.
The Logger class can be used to create higher level logging filters and aggregators and use the MprLog as the
final output stream.
Properties
Qualifiers | Property | Type | Description |
get set | fixed | Boolean | Is the MPR logging fixed. Set to true if the application logging has been fixed by a hosting environment or
if the application initiated logging via a command line --log switch. |
get set | level | Number | The numeric verbosity setting (0-9) of this MprLog. Zero is least verbose, nine is the most verbose.
Messages with a lower (or equal) verbosity level than the MprLog's level are emitted.
WARNING: Changing the logging verbosity level will affect logging for all interpreters. |
Inherited Properties
MprLog Class Methods
Qualifiers | Method |
(No own class methods defined)
Inherited Methods
MprLog Instance Methods
Inherited Methods
Method Detail
- Description
- Emit messages to the MprLog stream at a given level.
- Parameters
level: Number | Verbosity level at which to emit the message (0-9). |
data: Array | Data messages to emit. |
- Description
- Redirect log output. WARNING: Redirecting the logging output will redirect messages for all interpreters.
- Parameters
location: String | Output location to send messages to. |
level: Number | Verbosity level for logging. [default: null] |
- Description
- Write data to the stream.Write messages to the MprLog stream at level 0. If the stream can accept all the write data, the call returns immediately with the number of bytes written.
If writing more data than the stream can absorb in sync mode, the call will block until the data is written.
If writing more data than the stream can absorb in async mode, the call will not block and will buffer the
data and return immediately. Some streams will require a flush() call to actually send the data.
A "writable" event will be issued when the stream can again absorb more data.
- Parameters
data: Array | Data to write. |
- Events
readable | Issued when data is written and a consumer can read without blocking. |
writable | Issued when the stream becomes empty and it is ready to be written to. |
- Returns
- A count of the bytes actually written.
- Throws
-
IOError: if there is an I/O error.