Trying to redirect the log messages using logback-android, so that messages can be saved in a file. However, it is not getting saved into a file.
This is my logback.xml file configration, which is stored under src/main/assets in my Android Studio
<configuration debug="true">
<!-- Create a file appender for a log in the application's data directory -->
<appender name="FILE" class="ch.qos.logback.classic.android.FileAppender">
<file>/data/com.test.equa/files/log/foo.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<!-- Write INFO (and higher-level) messages to the log file -->
<root level="INFO">
<appender-ref ref="FILE" />
</root>
</configuration>
This is piece of code where i am initiating the logging.
@Override
public void onCreate() {
super.onCreate();
loadData();
Logger log = LoggerFactory.getLogger(MyActivity.class);
log.error("Application Data setup in progress");
}
Issue: I continue to see the messages in the logcat, but i expect them to be stored in my android sd card memory.
Added the user permission in manifest for writting the logs in the sd card
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Am i missing some thing in this configuration, as i don't see any errors or message in my logcat for any configuration errors also. Can some one help me here