| ILogLog Method |
Log a message the specified log level.
Namespace: Hangfire.LoggingAssembly: Hangfire.Core (in Hangfire.Core.dll) Version: 1.5.0.0
Syntax bool Log(
LogLevel logLevel,
Func<string> messageFunc,
Exception exception = null
)
Function Log (
logLevel As LogLevel,
messageFunc As Func(Of String),
Optional exception As Exception = Nothing
) As Boolean
Parameters
- logLevel
- Type: Hangfire.LoggingLogLevel
The log level. - messageFunc
- Type: SystemFuncString
The message function. - exception (Optional)
- Type: SystemException
An optional exception.
Return Value
Type:
Booleantrue if the message was logged. Otherwise false.
Remarks
Note to implementers: the message func should not be called if the loglevel is not enabled
so as not to incur performance penalties.
To check IsEnabled call Log with only LogLevel and check the return value, no event will be written
See Also