Class JsonLogHandler
- java.lang.Object
-
- java.util.logging.Handler
-
- com.google.cloud.functions.invoker.gcf.JsonLogHandler
-
public final class JsonLogHandler extends Handler
A log handler that publishes log messages in a json format. This is StackDriver's "structured logging" format.
-
-
Constructor Summary
Constructors Constructor Description JsonLogHandler(PrintStream out, boolean closePrintStreamOnClose)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExecutionId(long threadId, String executionId)voidclose()voidflush()voidpublish(LogRecord record)voidremoveExecutionId(long threadId)-
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
-
-
-
Constructor Detail
-
JsonLogHandler
public JsonLogHandler(PrintStream out, boolean closePrintStreamOnClose)
-
-
Method Detail
-
close
public void close() throws SecurityException- Specified by:
closein classHandler- Throws:
SecurityException
-
addExecutionId
public void addExecutionId(long threadId, String executionId)
-
removeExecutionId
public void removeExecutionId(long threadId)
-
-