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()
Log entry severity as a
Severity enumeration. |
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)
Log entry severity as a
Severity enumeration. |
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
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
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
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
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 String getMessage()
Message body to log. Value from ToString() method from message object.
public void setMessage(String value)
Message body to log. Value from ToString() method from message object.
public byte[] getBinaryDataMessage()
Binary message body to log.
public void setBinaryDataMessage(byte[] value)
Binary message body to log.
public Charset getMessageEncoding()
Encoding for binary message body
public void setMessageEncoding(Charset value)
Encoding for binary message body
public String getCategory()
Category name used to route the log entry to a one or more sinks.
public void setCategory(String value)
Category name used to route the log entry to a one or more sinks.
public int getEventId()
Event number or identifier.
public void setEventId(int value)
Event number or identifier.
public LogLevel getSeverity()
Log entry severity as a Severity
enumeration. (Unspecified, Information, Warning or Error).
public void setSeverity(LogLevel value)
Log entry severity as a Severity
enumeration. (Unspecified, Information, Warning or Error).
public String getTitle()
Additional description of the log entry message.
public void setTitle(String value)
Additional description of the log entry message.
public Date getTimeStamp()
Date and time of the log entry message.
Date
object.public void setTimeStamp(Date value)
Date and time of the log entry message.
value
- a Date
object.public String getMachineName()
Name of the computer.
public void setMachineName(String value)
Name of the computer.
public String getAppDomainName()
The AppDomain in which we are running
public void setAppDomainName(String value)
The AppDomain in which we are running
public String getThreadName()
The name of the thread.
public void setThreadName(String value)
The name of the thread.
public com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> getContextualProperties()
Dictionary of key/value pairs to record.
public void setContextualProperties(com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,String> value)
Dictionary of key/value pairs to record.
public 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 String getErrorMessages()
Gets the error message with the LogEntry
public int getSequenceId()
The unique identifier of log event which is automatically generated and monotonously increasing.
public Throwable getInnerException()
Gets or sets the inner exception object.
public void setInnerException(Throwable value)
Gets or sets the inner exception object.
Copyright (c) 2008-2018 Aspose Pty Ltd. All Rights Reserved.