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
ACRA won't find a such file. Because new FileInputStream() uses root directory as starting point on Android. So one have to hard code an absolute path, for example /data/data/com.example.app/files/logs/app.log. For many reasons this is not a good practice. A fix is very simple
if (fileName.startsWith("/")) {
I really can't imagine any edge case when fileName.contains("/") is more correct. new FileInputStream() should be used only when a full path is passed to the ACRA config. And a full path should always start with /.
The text was updated successfully, but these errors were encountered:
#336
It turned out that the fix is a little bit more complicated because openFileInput doesn't work with path separators. The code from the pull request assumes that when a relative log file path is passed to ACRA, then it must be in the files directory or its sub-directory, for example applicationLogFile = "logs/app.log" I tested this with logback-android and the fix works fine.
Below is code fragment used to read an application log file
The problem is when a log file is in the main package sub directory.
ACRA won't find a such file. Because
new FileInputStream()
uses root directory as starting point on Android. So one have to hard code an absolute path, for example/data/data/com.example.app/files/logs/app.log
. For many reasons this is not a good practice. A fix is very simpleI really can't imagine any edge case when
fileName.contains("/")
is more correct.new FileInputStream()
should be used only when a full path is passed to the ACRA config. And a full path should always start with/
.The text was updated successfully, but these errors were encountered: