public class LogEntry extends Object
Represents a log message. Contains the common properties that are required for all log messages.
Constructor and Description |
---|
LogEntry()
Initialize a new instance of a
LogEntry class. |
LogEntry(byte[] binaryDataMessage)
Create a new instance of
LogEntry with a full set of constructor parameters |
LogEntry(byte[] binaryDataMessage,
Charset messageEncoding)
Create a new instance of
LogEntry with a full set of constructor parameters |
LogEntry(byte[] binaryDataMessage,
Charset messageEncoding,
com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> properties)
Create a new instance of
LogEntry with a full set of constructor parameters |
LogEntry(byte[] binaryDataMessage,
com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> properties)
Create a new instance of
LogEntry with a full set of constructor parameters |
LogEntry(String message)
Initialize a new instance of a
LogEntry class. |
LogEntry(String message,
Date time)
Initialize a new instance of a
LogEntry class. |
LogEntry(String message,
com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> properties)
Create a new instance of
LogEntry with a full set of constructor parameters |
LogEntry(String message,
LogLevel severity)
Initialize a new instance of a
LogEntry class. |
LogEntry(String message,
LogLevel severity,
String category,
int eventId,
String title,
com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> properties)
Create a new instance of
LogEntry with a full set of constructor parameters |
LogEntry(String message,
Throwable innerException)
Initialize a new instance of a
LogEntry class. |
LogEntry(String message,
Throwable innerException,
LogLevel severity)
Initialize a new instance of a
LogEntry class. |
LogEntry(String message,
Throwable innerException,
LogLevel severity,
String category,
int eventId,
String title,
com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> properties)
Create a new instance of
LogEntry with a full set of constructor parameters |
Modifier and Type | Method and Description |
---|---|
void |
addErrorMessage(String message)
Add an error or warning message to the start of the messages string builder.
|
LogEntry |
deepClone()
Creates a new
LogEntry that is a copy of the current instance. |
String |
getAppDomainName()
The AppDomain in which we are running
|
byte[] |
getBinaryDataMessage()
Binary message body to log.
|
String |
getCategory()
Category name used to route the log entry to a one or more sinks.
|
com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> |
getContextualProperties()
Dictionary of key/value pairs to record.
|
String |
getErrorMessages()
Gets the error message with the
LogEntry |
int |
getEventId()
Event number or identifier.
|
Throwable |
getInnerException()
Gets or sets the inner exception object.
|
String |
getMachineName()
Name of the computer.
|
String |
getMessage()
Message body to log.
|
Charset |
getMessageEncoding()
Encoding for binary message body
|
int |
getSequenceId()
The unique identifier of log event which is automatically generated
and monotonously increasing.
|
LogLevel |
getSeverity()
|
String |
getThreadName()
The name of the thread.
|
Date |
getTimeStamp()
Date and time of the log entry message.
|
String |
getTitle()
Additional description of the log entry message.
|
void |
setAppDomainName(String value)
The AppDomain in which we are running
|
void |
setBinaryDataMessage(byte[] value)
Binary message body to log.
|
void |
setCategory(String value)
Category name used to route the log entry to a one or more sinks.
|
void |
setContextualProperties(com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> value)
Dictionary of key/value pairs to record.
|
void |
setEventId(int value)
Event number or identifier.
|
void |
setInnerException(Throwable value)
Gets or sets the inner exception object.
|
void |
setMachineName(String value)
Name of the computer.
|
void |
setMessage(String value)
Message body to log.
|
void |
setMessageEncoding(Charset value)
Encoding for binary message body
|
void |
setSeverity(LogLevel value)
|
void |
setThreadName(String value)
The name of the thread.
|
void |
setTimeStamp(Date value)
Date and time of the log entry message.
|
void |
setTitle(String value)
Additional description of the log entry message.
|
String |
toString() |
public LogEntry()
Initialize a new instance of a LogEntry
class.
public LogEntry(String message)
Initialize a new instance of a LogEntry
class.
message
- The message.public LogEntry(String message, Date time)
Initialize a new instance of a LogEntry
class.
message
- The message.time
- The time.public LogEntry(String message, Throwable innerException)
Initialize a new instance of a LogEntry
class.
message
- Message body to log. Value from ToString() method from message object.innerException
- The inner exception to log.public LogEntry(String message, LogLevel severity)
Initialize a new instance of a LogEntry
class.
message
- Message body to log. Value from ToString() method from message object.severity
- Log entry severity as a Severity
(getSeverity()
/setSeverity(LogLevel)
) enumeration. (Unspecified, Information, Warning or Error).public LogEntry(String message, Throwable innerException, LogLevel severity)
Initialize a new instance of a LogEntry
class.
message
- Message body to log. Value from ToString() method from message object.innerException
- The inner exception to log.severity
- Log entry severity as a Severity
(getSeverity()
/setSeverity(LogLevel)
) enumeration. (Unspecified, Information, Warning or Error).public LogEntry(String message, com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> properties)
Create a new instance of LogEntry
with a full set of constructor parameters
message
- Message body to log. Value from ToString() method from message object.properties
- Dictionary of key/value pairs to record.public LogEntry(byte[] binaryDataMessage)
Create a new instance of LogEntry
with a full set of constructor parameters
binaryDataMessage
- Binary message body to log.public LogEntry(byte[] binaryDataMessage, Charset messageEncoding)
Create a new instance of LogEntry
with a full set of constructor parameters
binaryDataMessage
- Binary message body to log.messageEncoding
- Encoding for binary messagepublic LogEntry(byte[] binaryDataMessage, com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> properties)
Create a new instance of LogEntry
with a full set of constructor parameters
binaryDataMessage
- Binary message body to log.properties
- Dictionary of key/value pairs to record.public LogEntry(byte[] binaryDataMessage, Charset messageEncoding, com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> properties)
Create a new instance of LogEntry
with a full set of constructor parameters
binaryDataMessage
- Binary message body to log.messageEncoding
- Encoding for binary messageproperties
- Dictionary of key/value pairs to record.public LogEntry(String message, LogLevel severity, String category, int eventId, String title, com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> properties)
Create a new instance of LogEntry
with a full set of constructor parameters
message
- Message body to log. Value from ToString() method from message object.severity
- Log entry severity as a Severity
(getSeverity()
/setSeverity(LogLevel)
) enumeration. (Unspecified, Information, Warning or Error).category
- Category name used to route the log entry to a one or more sinks.eventId
- Event number or identifier.title
- Additional description of the log entry message.properties
- Dictionary of key/value pairs to record.public LogEntry(String message, Throwable innerException, LogLevel severity, String category, int eventId, String title, com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> properties)
Create a new instance of LogEntry
with a full set of constructor parameters
message
- Message body to log. Value from ToString() method from message object.innerException
- The inner exception to log.severity
- Log entry severity as a Severity
(getSeverity()
/setSeverity(LogLevel)
) enumeration. (Unspecified, Information, Warning or Error).category
- Category name used to route the log entry to a one or more sinks.eventId
- Event number or identifier.title
- Additional description of the log entry message.properties
- Dictionary of key/value pairs to record.public final String getMessage()
Message body to log. Value from ToString() method from message object.
public final void setMessage(String value)
Message body to log. Value from ToString() method from message object.
public final byte[] getBinaryDataMessage()
Binary message body to log.
public final void setBinaryDataMessage(byte[] value)
Binary message body to log.
public final Charset getMessageEncoding()
Encoding for binary message body
public final void setMessageEncoding(Charset value)
Encoding for binary message body
public final String getCategory()
Category name used to route the log entry to a one or more sinks.
public final void setCategory(String value)
Category name used to route the log entry to a one or more sinks.
public final int getEventId()
Event number or identifier.
public final void setEventId(int value)
Event number or identifier.
public final LogLevel getSeverity()
Log entry severity as a Severity
(getSeverity()
/setSeverity(LogLevel)
) enumeration. (Unspecified, Information, Warning or Error).
public final void setSeverity(LogLevel value)
Log entry severity as a Severity
(getSeverity()
/setSeverity(LogLevel)
) enumeration. (Unspecified, Information, Warning or Error).
public final String getTitle()
Additional description of the log entry message.
public final void setTitle(String value)
Additional description of the log entry message.
public final Date getTimeStamp()
Date and time of the log entry message.
public final void setTimeStamp(Date value)
Date and time of the log entry message.
public final String getMachineName()
Name of the computer.
public final void setMachineName(String value)
Name of the computer.
public final String getAppDomainName()
The AppDomain in which we are running
public final void setAppDomainName(String value)
The AppDomain in which we are running
public final String getThreadName()
The name of the thread.
public final void setThreadName(String value)
The name of the thread.
public final com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> getContextualProperties()
Dictionary of key/value pairs to record.
public final void setContextualProperties(com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> value)
Dictionary of key/value pairs to record.
public final LogEntry deepClone()
Creates a new LogEntry
that is a copy of the current instance.
LogEntry
that is a copy of the current instance.public void addErrorMessage(String message)
Add an error or warning message to the start of the messages string builder. Used by the distributor to record problems.
message
- Message to be added to this instancepublic final int getSequenceId()
The unique identifier of log event which is automatically generated and monotonously increasing.
public final Throwable getInnerException()
Gets or sets the inner exception object.
public final void setInnerException(Throwable value)
Gets or sets the inner exception object.