My config is below:
<logback>
<configuration debug="true">
<appender
name="LOGCAT"
class="ch.qos.logback.classic.android.LogcatAppender" >
<tagEncoder>
<pattern>%logger{0}</pattern>
</tagEncoder>
<encoder>
<pattern>%d{HH:mm:ss} - %msg %n</pattern>
</encoder>
</appender>
<appender
name="File"
class="ch.qos.logback.core.rolling.RollingFileAppender" >
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%d{HH:mm:ss} [%thread] [%.-1level] - %msg %n</pattern>
</encoder>
<File>${log_path:-}agent.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy" >
<FileNamePattern>${log_path:-}agent.%d{yyyy-MM-dd}.zip</FileNamePattern>
<!-- keep 7 days' worth of history -->
<MaxHistory>7</MaxHistory>
<TimeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP" >
<MaxFileSize>10MB</MaxFileSize><!-- MaxFileSize should be just above daily log size -->
</TimeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<root level="TRACE" >
<!-- <appender-ref ref="LOGCAT" /> -->
<appender-ref ref="File" />
</root>
</configuration>
</logback>
And I set ${log_path:-} during Log class initialization like below:
static {
init();
}
public static void init() {
Log.d("MDMLog","Log init starts!");
System.setProperty("log_path", Environment.getExternalStorageDirectory() + "/neusoft/mdm/log/");
//Reload:
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
ContextInitializer ci = new ContextInitializer(lc);
lc.reset();
try {
//I prefer autoConfig() over JoranConfigurator.doConfigure() so I wouldn't need to find the file myself.
ci.autoConfig();
} catch (JoranException e) {
// StatusPrinter will try to log this
Log.d(TAG,"Exception happened during configuring!",e);
}
Log.d(TAG,"Print logback status-------------------------start");
StatusPrinter.printInCaseOfErrorsOrWarnings(lc);
Log.d(TAG,"Print logback status-------------------------end");
}
I got twice java.io.FileNotFoundException
I/ActivityManager( 94): Start proc com.neusoft.mdm for activity com.neusoft.mdm/.MDMAgentMain: pid=975 uid=10036 gids={3003, 3002, 3001, 1015}
I/ActivityThread( 975): Pub com.neusoft.mdm.database.mdmbaseproivder: com.neusoft.mdm.database.MDMContentProvider
D/DBParts ( 975): create DBParts.
V/RenderScript_jni( 190): surfaceDestroyed
I/System.out( 975): 01:50:24,948 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.android.LogcatAppender]
I/System.out( 975): 01:50:24,951 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [LOGCAT]
I/System.out( 975): 01:50:24,960 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [tagEncoder] property
I/System.out( 975): 01:50:24,977 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
I/System.out( 975): 01:50:24,983 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
I/System.out( 975): 01:50:24,985 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [File]
I/System.out( 975): 01:50:25,031 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use zip compression
I/System.out( 975): 01:50:25,033 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern agent.%d{yyyy-MM-dd} for the active file
I/System.out( 975): 01:50:25,042 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - The date pattern is 'yyyy-MM-dd' from file name pattern 'agent.%d{yyyy-MM-dd}.zip'.
I/System.out( 975): 01:50:25,042 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - Roll-over at midnight.
I/System.out( 975): 01:50:25,043 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - Setting initial period to Sat Jan 28 01:50:25 ๆ ผๆๅฐผๆฒปๆ ๅๆถ้ด+0000 2012
I/System.out( 975): 01:50:25,046 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - Active log file name: agent.log
I/System.out( 975): 01:50:25,047 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - File property is set to [agent.log]
I/System.out( 975): 01:50:25,049 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[File] - openFile(agent.log,true) call failed. java.io.FileNotFoundException: /agent.log (Read-only file system)
I/System.out( 975): at java.io.FileNotFoundException: /agent.log (Read-only file system)
I/System.out( 975): at at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
I/System.out( 975): at at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
I/System.out( 975): at at java.io.FileOutputStream.(FileOutputStream.java:94)
I/System.out( 975): at at ch.qos.logback.core.recovery.ResilientFileOutputStream.(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.FileAppender.openFile(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.FileAppender.start(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.rolling.RollingFileAppender.start(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.action.AppenderAction.end(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.EventPlayer.play(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source)
I/System.out( 975): at at ch.qos.logback.classic.util.ContextInitializer.configureByManifest(Unknown Source)
I/System.out( 975): at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(Unknown Source)
I/System.out( 975): at at org.slf4j.impl.StaticLoggerBinder.init(Unknown Source)
I/System.out( 975): at at org.slf4j.impl.StaticLoggerBinder.(Unknown Source)
I/System.out( 975): at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
I/System.out( 975): at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
I/System.out( 975): at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
I/System.out( 975): at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
I/System.out( 975): at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
I/System.out( 975): at at com.neusoft.mdm.util.MDMLog.(MDMLog.java:15)
I/System.out( 975): at at com.neusoft.mdm.MDMAgentMain.onCreate(MDMAgentMain.java:17)
I/System.out( 975): at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
I/System.out( 975): at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
I/System.out( 975): at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
I/System.out( 975): at at android.app.ActivityThread.access$1500(ActivityThread.java:117)
I/System.out( 975): at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
I/System.out( 975): at at android.os.Handler.dispatchMessage(Handler.java:99)
I/System.out( 975): at at android.os.Looper.loop(Looper.java:123)
I/System.out( 975): at at android.app.ActivityThread.main(ActivityThread.java:3683)
I/System.out( 975): at at java.lang.reflect.Method.invokeNative(Native Method)
I/System.out( 975): at at java.lang.reflect.Method.invoke(Method.java:507)
I/System.out( 975): at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
I/System.out( 975): at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
I/System.out( 975): at at dalvik.system.NativeStart.main(Native Method)
I/System.out( 975): 01:50:25,059 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to TRACE
I/System.out( 975): 01:50:25,060 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [File] to Logger[ROOT]
I/System.out( 975): 01:50:25,062 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
I/System.out( 975): 01:50:24,633 |-WARN in ch.qos.logback.classic.LoggerContext[default] - No config in SD card
I/System.out( 975): 01:50:24,635 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [AndroidManifest.xml] at [jar:file:/data/app/com.neusoft.mdm-2.apk!/AndroidManifest.xml]
I/System.out( 975): 01:50:24,948 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.android.LogcatAppender]
I/System.out( 975): 01:50:24,951 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [LOGCAT]
I/System.out( 975): 01:50:24,960 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [tagEncoder] property
I/System.out( 975): 01:50:24,977 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
I/System.out( 975): 01:50:24,983 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
I/System.out( 975): 01:50:24,985 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [File]
I/System.out( 975): 01:50:25,031 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use zip compression
I/System.out( 975): 01:50:25,033 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern agent.%d{yyyy-MM-dd} for the active file
I/System.out( 975): 01:50:25,042 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - The date pattern is 'yyyy-MM-dd' from file name pattern 'agent.%d{yyyy-MM-dd}.zip'.
I/System.out( 975): 01:50:25,042 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - Roll-over at midnight.
I/System.out( 975): 01:50:25,043 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - Setting initial period to Sat Jan 28 01:50:25 ๆ ผๆๅฐผๆฒปๆ ๅๆถ้ด+0000 2012
I/System.out( 975): 01:50:25,046 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - Active log file name: agent.log
I/System.out( 975): 01:50:25,047 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - File property is set to [agent.log]
I/System.out( 975): 01:50:25,049 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[File] - openFile(agent.log,true) call failed. java.io.FileNotFoundException: /agent.log (Read-only file system)
I/System.out( 975): at java.io.FileNotFoundException: /agent.log (Read-only file system)
I/System.out( 975): at at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
I/System.out( 975): at at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
I/System.out( 975): at at java.io.FileOutputStream.(FileOutputStream.java:94)
I/System.out( 975): at at ch.qos.logback.core.recovery.ResilientFileOutputStream.(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.FileAppender.openFile(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.FileAppender.start(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.rolling.RollingFileAppender.start(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.action.AppenderAction.end(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.EventPlayer.play(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source)
I/System.out( 975): at at ch.qos.logback.classic.util.ContextInitializer.configureByManifest(Unknown Source)
I/System.out( 975): at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(Unknown Source)
I/System.out( 975): at at org.slf4j.impl.StaticLoggerBinder.init(Unknown Source)
I/System.out( 975): at at org.slf4j.impl.StaticLoggerBinder.(Unknown Source)
I/System.out( 975): at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
I/System.out( 975): at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
I/System.out( 975): at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
I/System.out( 975): at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
I/System.out( 975): at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
I/System.out( 975): at at com.neusoft.mdm.util.MDMLog.(MDMLog.java:15)
I/System.out( 975): at at com.neusoft.mdm.MDMAgentMain.onCreate(MDMAgentMain.java:17)
I/System.out( 975): at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
I/System.out( 975): at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
I/System.out( 975): at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
I/System.out( 975): at at android.app.ActivityThread.access$1500(ActivityThread.java:117)
I/System.out( 975): at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
I/System.out( 975): at at android.os.Handler.dispatchMessage(Handler.java:99)
I/System.out( 975): at at android.os.Looper.loop(Looper.java:123)
I/System.out( 975): at at android.app.ActivityThread.main(ActivityThread.java:3683)
I/System.out( 975): at at java.lang.reflect.Method.invokeNative(Native Method)
I/System.out( 975): at at java.lang.reflect.Method.invoke(Method.java:507)
I/System.out( 975): at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
I/System.out( 975): at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
I/System.out( 975): at at dalvik.system.NativeStart.main(Native Method)
I/System.out( 975): 01:50:25,059 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to TRACE
I/System.out( 975): 01:50:25,060 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [File] to Logger[ROOT]
I/System.out( 975): 01:50:25,062 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
D/MDMLog ( 975): Log init starts!
D/dalvikvm( 975): GC_CONCURRENT freed 1164K, 57% free 2959K/6727K, external 1625K/2137K, paused 4ms+3ms
I/System.out( 975): 01:50:25,031 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use zip compression
I/System.out( 975): 01:50:25,033 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern agent.%d{yyyy-MM-dd} for the active file
I/System.out( 975): 01:50:25,042 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - The date pattern is 'yyyy-MM-dd' from file name pattern 'agent.%d{yyyy-MM-dd}.zip'.
I/System.out( 975): 01:50:25,042 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - Roll-over at midnight.
I/System.out( 975): 01:50:25,043 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - Setting initial period to Sat Jan 28 01:50:25 ๆ ผๆๅฐผๆฒปๆ ๅๆถ้ด+0000 2012
I/System.out( 975): 01:50:25,046 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - Active log file name: agent.log
I/System.out( 975): 01:50:25,047 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - File property is set to [agent.log]
I/System.out( 975): 01:50:25,049 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[File] - openFile(agent.log,true) call failed. java.io.FileNotFoundException: /agent.log (Read-only file system)
I/System.out( 975): at java.io.FileNotFoundException: /agent.log (Read-only file system)
I/System.out( 975): at at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
I/System.out( 975): at at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
I/System.out( 975): at at java.io.FileOutputStream.(FileOutputStream.java:94)
I/System.out( 975): at at ch.qos.logback.core.recovery.ResilientFileOutputStream.(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.FileAppender.openFile(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.FileAppender.start(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.rolling.RollingFileAppender.start(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.action.AppenderAction.end(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.EventPlayer.play(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source)
I/System.out( 975): at at ch.qos.logback.classic.util.ContextInitializer.configureByManifest(Unknown Source)
I/System.out( 975): at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(Unknown Source)
I/System.out( 975): at at org.slf4j.impl.StaticLoggerBinder.init(Unknown Source)
I/System.out( 975): at at org.slf4j.impl.StaticLoggerBinder.(Unknown Source)
I/System.out( 975): at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
I/System.out( 975): at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
I/System.out( 975): at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
I/System.out( 975): at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
I/System.out( 975): at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
I/System.out( 975): at at com.neusoft.mdm.util.MDMLog.(MDMLog.java:15)
I/System.out( 975): at at com.neusoft.mdm.MDMAgentMain.onCreate(MDMAgentMain.java:17)
I/System.out( 975): at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
I/System.out( 975): at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
I/System.out( 975): at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
I/System.out( 975): at at android.app.ActivityThread.access$1500(ActivityThread.java:117)
I/System.out( 975): at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
I/System.out( 975): at at android.os.Handler.dispatchMessage(Handler.java:99)
I/System.out( 975): at at android.os.Looper.loop(Looper.java:123)
I/System.out( 975): at at android.app.ActivityThread.main(ActivityThread.java:3683)
I/System.out( 975): at at java.lang.reflect.Method.invokeNative(Native Method)
I/System.out( 975): at at java.lang.reflect.Method.invoke(Method.java:507)
I/System.out( 975): at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
I/System.out( 975): at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
I/System.out( 975): at at dalvik.system.NativeStart.main(Native Method)
I/System.out( 975): 01:50:25,059 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to TRACE
I/System.out( 975): 01:50:25,060 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [File] to Logger[ROOT]
I/System.out( 975): 01:50:25,062 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
I/System.out( 975): 01:50:25,086 |-WARN in ch.qos.logback.classic.LoggerContext[default] - No config in SD card
I/System.out( 975): 01:50:25,087 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [AndroidManifest.xml] at [jar:file:/data/app/com.neusoft.mdm-2.apk!/AndroidManifest.xml]
I/System.out( 975): 01:50:25,336 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.android.LogcatAppender]
I/System.out( 975): 01:50:25,338 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [LOGCAT]
I/System.out( 975): 01:50:25,342 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [tagEncoder] property
I/System.out( 975): 01:50:25,350 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
I/System.out( 975): 01:50:25,357 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
I/System.out( 975): 01:50:25,358 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [File]
I/System.out( 975): 01:50:25,423 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use zip compression
I/System.out( 975): 01:50:25,424 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern /mnt/sdcard/neusoft/mdm/log/agent.%d{yyyy-MM-dd} for the active file
D/dalvikvm( 975): GC_CONCURRENT freed 738K, 57% free 2911K/6727K, external 1625K/2137K, paused 2ms+4ms
I/System.out( 975): 01:50:25,452 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@405c11d0 - The date pattern is 'yyyy-MM-dd' from file name pattern '/mnt/sdcard/neusoft/mdm/log/agent.%d{yyyy-MM-dd}.zip'.
I/System.out( 975): 01:50:25,453 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@405c11d0 - Roll-over at midnight.
I/System.out( 975): 01:50:25,455 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@405c11d0 - Setting initial period to Sat Jan 28 01:45:28 ๆ ผๆๅฐผๆฒปๆ ๅๆถ้ด+0000 2012
I/System.out( 975): 01:50:25,458 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - Active log file name: /mnt/sdcard/neusoft/mdm/log/agent.log
I/System.out( 975): 01:50:25,460 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - File property is set to [/mnt/sdcard/neusoft/mdm/log/agent.log]
I/System.out( 975): 01:50:25,461 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to TRACE
I/System.out( 975): 01:50:25,462 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [File] to Logger[ROOT]
I/System.out( 975): 01:50:25,463 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
D/MDMLog ( 975): Print logback status-------------------------start
I/System.out( 975): 01:50:24,633 |-WARN in ch.qos.logback.classic.LoggerContext[default] - No config in SD card
I/System.out( 975): 01:50:24,635 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [AndroidManifest.xml] at [jar:file:/data/app/com.neusoft.mdm-2.apk!/AndroidManifest.xml]
I/System.out( 975): 01:50:24,948 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.android.LogcatAppender]
I/System.out( 975): 01:50:24,951 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [LOGCAT]
I/System.out( 975): 01:50:24,960 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [tagEncoder] property
I/System.out( 975): 01:50:24,977 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
I/System.out( 975): 01:50:24,983 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
I/System.out( 975): 01:50:24,985 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [File]
I/System.out( 975): 01:50:25,031 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use zip compression
I/System.out( 975): 01:50:25,033 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern agent.%d{yyyy-MM-dd} for the active file
I/System.out( 975): 01:50:25,042 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - The date pattern is 'yyyy-MM-dd' from file name pattern 'agent.%d{yyyy-MM-dd}.zip'.
I/System.out( 975): 01:50:25,042 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - Roll-over at midnight.
I/System.out( 975): 01:50:25,043 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@40620f60 - Setting initial period to Sat Jan 28 01:50:25 ๆ ผๆๅฐผๆฒปๆ ๅๆถ้ด+0000 2012
I/System.out( 975): 01:50:25,046 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - Active log file name: agent.log
I/System.out( 975): 01:50:25,047 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - File property is set to [agent.log]
I/System.out( 975): 01:50:25,049 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[File] - openFile(agent.log,true) call failed. java.io.FileNotFoundException: /agent.log (Read-only file system)
I/System.out( 975): at java.io.FileNotFoundException: /agent.log (Read-only file system)
I/System.out( 975): at at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
I/System.out( 975): at at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
I/System.out( 975): at at java.io.FileOutputStream.(FileOutputStream.java:94)
I/System.out( 975): at at ch.qos.logback.core.recovery.ResilientFileOutputStream.(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.FileAppender.openFile(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.FileAppender.start(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.rolling.RollingFileAppender.start(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.action.AppenderAction.end(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.spi.EventPlayer.play(Unknown Source)
I/System.out( 975): at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Unknown Source)
I/System.out( 975): at at ch.qos.logback.classic.util.ContextInitializer.configureByManifest(Unknown Source)
I/System.out( 975): at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(Unknown Source)
I/System.out( 975): at at org.slf4j.impl.StaticLoggerBinder.init(Unknown Source)
I/System.out( 975): at at org.slf4j.impl.StaticLoggerBinder.(Unknown Source)
I/System.out( 975): at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
I/System.out( 975): at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
I/System.out( 975): at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
I/System.out( 975): at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
I/System.out( 975): at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
I/System.out( 975): at at com.neusoft.mdm.util.MDMLog.(MDMLog.java:15)
I/System.out( 975): at at com.neusoft.mdm.MDMAgentMain.onCreate(MDMAgentMain.java:17)
I/System.out( 975): at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
I/System.out( 975): at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
I/System.out( 975): at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
I/System.out( 975): at at android.app.ActivityThread.access$1500(ActivityThread.java:117)
I/System.out( 975): at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
I/System.out( 975): at at android.os.Handler.dispatchMessage(Handler.java:99)
I/System.out( 975): at at android.os.Looper.loop(Looper.java:123)
I/System.out( 975): at at android.app.ActivityThread.main(ActivityThread.java:3683)
I/System.out( 975): at at java.lang.reflect.Method.invokeNative(Native Method)
I/System.out( 975): at at java.lang.reflect.Method.invoke(Method.java:507)
I/System.out( 975): at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
I/System.out( 975): at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
I/System.out( 975): at at dalvik.system.NativeStart.main(Native Method)
I/System.out( 975): 01:50:25,059 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to TRACE
I/System.out( 975): 01:50:25,060 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [File] to Logger[ROOT]
I/System.out( 975): 01:50:25,062 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
I/System.out( 975): 01:50:25,086 |-WARN in ch.qos.logback.classic.LoggerContext[default] - No config in SD card
I/System.out( 975): 01:50:25,087 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [AndroidManifest.xml] at [jar:file:/data/app/com.neusoft.mdm-2.apk!/AndroidManifest.xml]
I/System.out( 975): 01:50:25,336 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.android.LogcatAppender]
I/System.out( 975): 01:50:25,338 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [LOGCAT]
I/System.out( 975): 01:50:25,342 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [tagEncoder] property
I/System.out( 975): 01:50:25,350 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
I/System.out( 975): 01:50:25,357 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
I/System.out( 975): 01:50:25,358 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [File]
I/System.out( 975): 01:50:25,423 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use zip compression
I/System.out( 975): 01:50:25,424 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern /mnt/sdcard/neusoft/mdm/log/agent.%d{yyyy-MM-dd} for the active file
I/System.out( 975): 01:50:25,452 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@405c11d0 - The date pattern is 'yyyy-MM-dd' from file name pattern '/mnt/sdcard/neusoft/mdm/log/agent.%d{yyyy-MM-dd}.zip'.
I/System.out( 975): 01:50:25,453 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@405c11d0 - Roll-over at midnight.
I/System.out( 975): 01:50:25,455 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@405c11d0 - Setting initial period to Sat Jan 28 01:45:28 ๆ ผๆๅฐผๆฒปๆ ๅๆถ้ด+0000 2012
I/System.out( 975): 01:50:25,458 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - Active log file name: /mnt/sdcard/neusoft/mdm/log/agent.log
I/System.out( 975): 01:50:25,460 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[File] - File property is set to [/mnt/sdcard/neusoft/mdm/log/agent.log]
I/System.out( 975): 01:50:25,461 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to TRACE
I/System.out( 975): 01:50:25,462 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [File] to Logger[ROOT]
I/System.out( 975): 01:50:25,463 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
D/MDMLog ( 975): Print logback status-------------------------end
I wonder how can I prevent the exception happening.