public class CloseableLogContext extends Object implements CloseableContext
This provides 4 default diagnose context keys
Context Key | Meaning |
---|---|
xsn | The source of the log, this could be the name of the project for example, or system if it is a system generated log |
xsv | The source version of the log, which could be the project version for example |
host | The host from which this log is generated |
ip | The IP address from which this log is generated |
Apart from this any system property or environment variable set in the environment that starts with
org_adroitlogic_logger
is also included into the diagnose context with the respective key
Modifier and Type | Field and Description |
---|---|
static String |
EXTERNAL_FIELD_PREFIX
Prefix to capture external fields
|
static String |
SOURCE_NAME_KEY
The thread context key used to include the project id argument
|
static String |
SOURCE_VERSION_KEY
The thread context key used to include the project version argument
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
static CloseableContext |
defaultContext() |
static CloseableContext |
forProject(String projectId,
String version) |
CloseableContext |
mergeInto(CloseableContext ctx) |
CloseableContext |
put(String key,
String value) |
(package private) static CloseableLogContext |
systemContext() |
public static final String EXTERNAL_FIELD_PREFIX
public static final String SOURCE_NAME_KEY
public static final String SOURCE_VERSION_KEY
static CloseableLogContext systemContext()
public static CloseableContext defaultContext()
public static CloseableContext forProject(String projectId, String version)
public CloseableContext put(String key, String value)
put
in interface CloseableContext
public CloseableContext mergeInto(CloseableContext ctx)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2016–2019 AdroitLogic. All rights reserved.