Comments (2)
The example below works correctly (using your config) with logback-android-1.0.1-1
from a 4.0.3 emulator in OSX Lion. Please provide a complete code sample that reproduces the problem and indicate your platform details. Thanks.
Sample code
package com.example;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.app.Activity;
import android.os.Bundle;
public class HelloLogbackActivity extends Activity {
private static final Logger flogger = LoggerFactory.getLogger("flog");
private static final Logger clogger = LoggerFactory.getLogger(Clog.class);
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
flogger.debug("from flogger");
clogger.debug("from clogger");
}
}
class Clog {
// stub
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".HelloLogbackActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<logback>
<configuration>
<appender name="LOGCAT" class="ch.qos.logback.classic.android.LogcatAppender">
<checkLoggable>false</checkLoggable>
<tagEncoder>
<pattern>acme.%logger{15}</pattern>
</tagEncoder>
<encoder>
<pattern>[%method] %msg%n</pattern>
</encoder>
</appender>
<root level="TRACE" >
<appender-ref ref="LOGCAT" />
</root>
</configuration>
</logback>
</manifest>
logcat output
D/acme.flog( 541): [onCreate] from flogger
D/acme.c.example.Clog( 541): [onCreate] from clogger
from logback-android.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from logback-android.
Related Issues (20)
- Document usage compatible with the standard JUnit tests
- write log after app killed ,how to write log real time HOT 1
- Log file is not creating at very first time when app gets launched in android. HOT 5
- No log is printed with Slf4j 2.x.x HOT 10
- Missing SSL parameter configuration HOT 1
- Dependency Dashboard
- how to rename locback.xml as logback-demo.xml HOT 1
- Caused by java.lang.NullPointerException Attempt to invoke interface method 'void androidx.appcompat.view.menu.d.u(int)' on a null object reference HOT 1
- ArrayIndexOutOfBoundsException on Android 10
- LogcatAppender show errors for logs' "highlighting".
- Lazy setting does not work
- Can't Create Logger: DateTokenConverter not found? HOT 2
- The log cannot be written correctly in the case of multi-process Android application? HOT 2
- Cannot create AAR with ./scripts/makejar.sh HOT 1
- Excepton in kotlin app with jetpack compose, only in release mode HOT 1
- Missing transitive dependency on slf4j-api-2.x
- The release version turns on minifyEnabled, and the file name is printed as null. <pattern>[%date] [%file:%line] - %msg%n</pattern>
- logback-android and logback-classic ILoggingEvent binary incompatibility getMarkers vs getMarkerList HOT 1
- can not write to the file that under the android getExternalFilesDir()
- App death during rollover causes losing logs and malformed gz files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logback-android.