You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, our logging has two options: CONSOLE or FILE. CONSOLE prints to stdout. FILE writes to a file, always relative to java.io.tmpdir (source) and this is the issue. In some environments, the directory to java.io.tmpdir is not accessible and the property cannot be overridden.
solution
The file path can be set with the XML element <BaseFolder />
If the specified path is absolute, use that exact path.
If the specified path is relative, use that path relative to java.io.tmpdir.
possible fallout
On windows: if someone currently has the BaseFolder set to a path with a leading slash, e.g. \mylogdir, then after this change, logs will then be written to the default drive instead of under java.io.tmpdir.
On Linux: same issue. leading slash would write to a different directory.
Note: if the file logger cannot write (e.g. if writing to file throws an IOException), it falls back to console logger. In the examples above, this will be the case if the application cannot write to /.
@littleaj and @grlima we should consider this proposal carefully. I believe it might open any security concerns, as it is very possible that logs may contain sensitive customer information.
Right now, our logging has two options:
CONSOLE
orFILE
.CONSOLE
prints to stdout.FILE
writes to a file, always relative tojava.io.tmpdir
(source) and this is the issue. In some environments, the directory tojava.io.tmpdir
is not accessible and the property cannot be overridden.solution
The file path can be set with the XML element
<BaseFolder />
If the specified path is absolute, use that exact path.
If the specified path is relative, use that path relative to
java.io.tmpdir
.possible fallout
On windows: if someone currently has the BaseFolder set to a path with a leading slash, e.g.
\mylogdir
, then after this change, logs will then be written to the default drive instead of under java.io.tmpdir.On Linux: same issue. leading slash would write to a different directory.
Note: if the file logger cannot write (e.g. if writing to file throws an IOException), it falls back to console logger. In the examples above, this will be the case if the application cannot write to
/
.additional tasks
Update https://github.com/Microsoft/ApplicationInsights-Java/wiki/ApplicationInsights.XML with a description of the new functionality.
The text was updated successfully, but these errors were encountered: