0

With the usual logging tools (java.util.logging, log4j,...), log files have 664 permissions. Is there a way to limit these permission ? For example to 640 or 600.

PS : I can switch to an other logging tool.

Alexis Hassler
  • 752
  • 5
  • 16
  • possible duplicate of http://stackoverflow.com/questions/7893511/permissions-on-log-files-created-by-log4j-rollingfileappender – WhiteboardDev Jun 25 '15 at 16:50
  • The other question brings an answer for log4j, but I was wandering wether a most recent tool would have used the Java 7 capabilities with [java.nio.file.Files] (http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#getPosixFilePermissions%28java.nio.file.Path,%20java.nio.file.LinkOption...%29) – Alexis Hassler Jun 25 '15 at 17:21
  • Would setting the [umask](https://en.wikipedia.org/wiki/Umask) of your Java process from the shell that launches it suffice? – VGR Jun 25 '15 at 20:42
  • umask would be a good solution in main cases, but it affects all the files written by the application, not only the logs. – Alexis Hassler Jun 25 '15 at 20:45

0 Answers0