MprLog

Moduleejs
Definition class MprLog
InheritanceMprLog inherit Object
Specifiedejscript-2.5
StabilityPrototype.

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

QualifiersPropertyTypeDescription
get set fixedBooleanIs 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 levelNumberThe 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.

MprLog Class Methods

(No own class methods defined)

QualifiersMethod

MprLog Instance Methods

QualifiersMethod
emit(level: Number, data: Array): Number
 Emit messages to the MprLog stream at a given level.
redirect(location: String, level: Number = null): Void
 Redirect log output.
write(data: Array): Number
 Write data to the stream.Write messages to the MprLog stream at level 0.

Method Detail

emit(level: Number, data: Array): Number
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.

redirect(location: String, level: Number = null): Void
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]

write(data: Array): Number
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
readableIssued when data is written and a consumer can read without blocking.
writableIssued 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.