Package org.apache.ignite.logger.java
Class JavaLoggerFileHandler
- java.lang.Object
-
- java.util.logging.Handler
-
- java.util.logging.StreamHandler
-
- org.apache.ignite.logger.java.JavaLoggerFileHandler
-
public final class JavaLoggerFileHandler extends StreamHandler
File logging handler which skips all the messages until node ID is set.
-
-
Constructor Summary
Constructors Constructor Description JavaLoggerFileHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()@Nullable StringfileName()Returns current log file.voidflush()booleanisLoggable(LogRecord record)static FilelogDirectory(String workDir)Resolves logging directory.voidnodeId(@Nullable String app, @Nullable UUID nodeId, String workDir)Sets Node id and instantiatesFileHandlerdelegate.voidnodeId(UUID nodeId, String workDir)Sets Node id and instantiatesFileHandlerdelegate.voidpublish(LogRecord record)StringtoString()-
Methods inherited from class java.util.logging.StreamHandler
setEncoding, setOutputStream
-
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, reportError, setErrorManager, setFilter, setFormatter, setLevel
-
-
-
-
Method Detail
-
publish
public void publish(LogRecord record)
- Overrides:
publishin classStreamHandler
-
flush
public void flush()
- Overrides:
flushin classStreamHandler
-
close
public void close() throws SecurityException- Overrides:
closein classStreamHandler- Throws:
SecurityException
-
isLoggable
public boolean isLoggable(LogRecord record)
- Overrides:
isLoggablein classStreamHandler
-
nodeId
public void nodeId(UUID nodeId, String workDir) throws IgniteCheckedException, IOException
Sets Node id and instantiatesFileHandlerdelegate.- Parameters:
nodeId- Node id.workDir- param.- Throws:
IgniteCheckedExceptionIOException
-
nodeId
public void nodeId(@Nullable @Nullable String app, @Nullable @Nullable UUID nodeId, String workDir) throws IgniteCheckedException, IOExceptionSets Node id and instantiatesFileHandlerdelegate.- Parameters:
app- Application name.nodeId- Node id.workDir- Path to the work directory.- Throws:
IgniteCheckedExceptionIOException
-
fileName
@Nullable public @Nullable String fileName()
Returns current log file.- Returns:
- Pattern or
nullif node id has not been set yet.
-
logDirectory
public static File logDirectory(String workDir) throws IgniteCheckedException
Resolves logging directory.- Parameters:
workDir- Work directory.- Returns:
- Logging directory.
- Throws:
IgniteCheckedException
-
-