Class PosixViewAttributeAction
java.lang.Object
org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
org.apache.logging.log4j.core.appender.rolling.action.AbstractPathAction
org.apache.logging.log4j.core.appender.rolling.action.PosixViewAttributeAction
@Plugin(name="PosixViewAttribute",
category="Core",
printObject=true)
public class PosixViewAttributeAction
extends AbstractPathAction
File POSIX attribute view action.
Allow to define file permissions, user and group for log files on POSIX supported OS.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder for the POSIX view attribute action. -
Field Summary
Fields inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
LOGGER
-
Method Summary
Modifier and TypeMethodDescriptionprotected FileVisitor<Path>
createFileVisitor
(Path basePath, List<PathCondition> conditions) Creates a newFileVisitor<Path>
to pass to theFiles.walkFileTree(Path, Set, int, FileVisitor)
method when theAbstractPathAction.execute()
method is invoked.Returns file group if defined and the OS supports POSIX/group file attribute view, null otherwise.Returns file owner if defined and the OS supports owner file attribute view, null otherwise.Returns POSIX file permissions if defined and the OS supports POSIX file attribute, null otherwise.toString()
Methods inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractPathAction
execute, execute, getBasePath, getBasePathString, getMaxDepth, getOptions, getPathConditions, getStrSubstitutor, isFollowSymbolicLinks
Methods inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
close, isComplete, isInterrupted, reportException, run
-
Method Details
-
newBuilder
-
createFileVisitor
Description copied from class:AbstractPathAction
Creates a newFileVisitor<Path>
to pass to theFiles.walkFileTree(Path, Set, int, FileVisitor)
method when theAbstractPathAction.execute()
method is invoked.The visitor is responsible for processing the files it encounters that are accepted by all filters.
- Specified by:
createFileVisitor
in classAbstractPathAction
- Parameters:
basePath
- base dir from where to start scanning for files to processconditions
- filters that determine if a file should be processed- Returns:
- a new
FileVisitor<Path>
-
getFilePermissions
Returns POSIX file permissions if defined and the OS supports POSIX file attribute, null otherwise.- Returns:
- File POSIX permissions
- See Also:
-
getFileOwner
Returns file owner if defined and the OS supports owner file attribute view, null otherwise.- Returns:
- File owner
- See Also:
-
getFileGroup
Returns file group if defined and the OS supports POSIX/group file attribute view, null otherwise.- Returns:
- File group
- See Also:
-
toString
- Overrides:
toString
in classAbstractPathAction
-