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
I am also getting similar issue but not logging in document directory. I wanted to have separate directory for my app. so trying to save log in "/storage/emulated/0/MyAppDirectory/logs" path. and it never created any log or directory for log.
compileSdk & targetSdk are 31.
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'com.github.tony19:logback-android:2.0.0'
and config logback.xml is taken from https://github.com/tony19/logback-android/wiki
app has below permission as well:
android.permission.WRITE_EXTERNAL_STORAGE"
android.permission.MANAGE_EXTERNAL_STORAGE"
Error in logcat:
I/System.out: 00:30:12,036 |-ERROR in ch.qos.logback.core.FileAppender[DebugLog] - Failed to create parent directories for [/storage/emulated/0/MyAppDirectory/logs/debug.log]
The text was updated successfully, but these errors were encountered:
In your case, you configured the log file location to be /storage/emulated/0/MyAppDirectory/logs/debug.log, which is in the root of /storage/emulated/0/. Android 11 doesn't allow writing to that location even with the permissions you requested.
You should change the location to be a subdiretory of Download (note it's singular) or Documents, as in:
/storage/emulated/0/Download/MyAppDirectory/logs/debug.log
# or
/storage/emulated/0/Documents/MyAppDirectory/logs/debug.log
Originally posted by @kunalvaibhav in #228 (comment):
The text was updated successfully, but these errors were encountered: