Logger

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.ms.System.IDisposable

public final class Logger implements System.IDisposable

Provides the logging functionality.

Methods

Method Description
getDebug() Gets the debug logger.
getSeverity() Gets or sets severity.
setSeverity(LogLevel value) Gets or sets severity.
getName() Gets or sets name.
getAppenders() Gets or sets the appender list.
setAppenders(AppenderCollection value) Gets or sets the appender list.
isEnabled(LogLevel level) Determines if logging is enabled for the specified level.
writeLine() Writes the empty line to appenders.
writeLine(String message) Writes the specified message to appenders.
writeLine(Object message) Writes the specified message to appenders.
writeFormat(String format, Object[] arguments) Writes the message with specified format to appenders.
write(String message) Writes the specified message to appenders.
write(String message, Exception exception) Writes the specified message and exception to appenders.
write(String message, Exception ex, LogLevel level) Writes the specified message and exception to appenders.
write(Object message) Writes the specified message to appenders.
writeIf(boolean condition, String message) Writes the specified message to appenders if condition is true.
writeIf(boolean condition, Object message) Writes the specified message to appenders if condition is true.
writeIf(boolean condition, Object message, Exception exception) Writes the specified message and exception to appenders if condition is true.
writeIf(LogLevel condition, String message) Writes the specified message if the log level is enabled.
writeIf(LogLevel condition, String message, Exception exception) Writes the specified message and exception if the log level is enabled.
dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

getDebug()

public static Logger getDebug()

Gets the debug logger.

Returns: Logger

getSeverity()

public final LogLevel getSeverity()

Gets or sets severity.

Returns: LogLevel

setSeverity(LogLevel value)

public final void setSeverity(LogLevel value)

Gets or sets severity.

Parameters:

Parameter Type Description
value LogLevel

getName()

public final String getName()

Gets or sets name.

Returns: java.lang.String

getAppenders()

public final AppenderCollection getAppenders()

Gets or sets the appender list.

Returns: AppenderCollection

setAppenders(AppenderCollection value)

public final void setAppenders(AppenderCollection value)

Gets or sets the appender list.

Parameters:

Parameter Type Description
value AppenderCollection

isEnabled(LogLevel level)

public final boolean isEnabled(LogLevel level)

Determines if logging is enabled for the specified level.

Parameters:

Parameter Type Description
level LogLevel level to be checked

Returns: boolean - ``` ``` if logging is enabled for the specified level, otherwise it returns ``` ```.

writeLine()

public final void writeLine()

Writes the empty line to appenders.

writeLine(String message)

public final void writeLine(String message)

Writes the specified message to appenders.

Parameters:

Parameter Type Description
message java.lang.String The message to write.

writeLine(Object message)

public final void writeLine(Object message)

Writes the specified message to appenders.

Parameters:

Parameter Type Description
message java.lang.Object The message to write.

writeFormat(String format, Object[] arguments)

public final void writeFormat(String format, Object[] arguments)

Writes the message with specified format to appenders.

Parameters:

Parameter Type Description
format java.lang.String
arguments java.lang.Object[]

write(String message)

public final void write(String message)

Writes the specified message to appenders.

Parameters:

Parameter Type Description
message java.lang.String The message to write.

write(String message, Exception exception)

public final void write(String message, Exception exception)

Writes the specified message and exception to appenders.

Parameters:

Parameter Type Description
message java.lang.String The message to write.
exception java.lang.Exception The exception to write.

write(String message, Exception ex, LogLevel level)

public final void write(String message, Exception ex, LogLevel level)

Writes the specified message and exception to appenders.

Parameters:

Parameter Type Description
message java.lang.String The message to write.
ex java.lang.Exception The exception to write.
level LogLevel The log level.

write(Object message)

public final void write(Object message)

Writes the specified message to appenders.

Parameters:

Parameter Type Description
message java.lang.Object The message to write.

writeIf(boolean condition, String message)

public final void writeIf(boolean condition, String message)

Writes the specified message to appenders if condition is true.

Parameters:

Parameter Type Description
condition boolean The condition to test.
message java.lang.String The message to write.

writeIf(boolean condition, Object message)

public final void writeIf(boolean condition, Object message)

Writes the specified message to appenders if condition is true.

Parameters:

Parameter Type Description
condition boolean The condition to test.
message java.lang.Object The message to write.

writeIf(boolean condition, Object message, Exception exception)

public final void writeIf(boolean condition, Object message, Exception exception)

Writes the specified message and exception to appenders if condition is true.

Parameters:

Parameter Type Description
condition boolean The condition to test.
message java.lang.Object The message to write.
exception java.lang.Exception The exception to write.

writeIf(LogLevel condition, String message)

public final void writeIf(LogLevel condition, String message)

Writes the specified message if the log level is enabled.

Parameters:

Parameter Type Description
condition LogLevel The log level.
message java.lang.String The message to log.

writeIf(LogLevel condition, String message, Exception exception)

public final void writeIf(LogLevel condition, String message, Exception exception)

Writes the specified message and exception if the log level is enabled.

Parameters:

Parameter Type Description
condition LogLevel The log level.
message java.lang.String The message to log.
exception java.lang.Exception The exception to log.

dispose()

public final void dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.