[logback-user] logback and proguard

Tony Trinh tony19 at gmail.com
Thu Feb 28 05:07:23 CET 2013


First, you might want to correct the -keep option for the slf4j classes
(there's an extra "public"):

-keep public *public* class org.slf4j.**


Then, try adding "{ *; }" to these -keep options:

-keep public class ch.qos.logback.** *{ *; }*
-keep public class org.slf4j.** *{ *; }*


Let me know if that works for you.

-Tony

On Tue, Feb 26, 2013 at 5:12 AM, Omer Azriel <amramaz at gmail.com> wrote:

>
>
> 2013/2/26 Omer Azriel <amramaz at gmail.com>
>
>> hello,
>> I use logback in my android application and it works great,
>> However, when I export the application and obfuscate the code using
>> Proguard, it does not work correctly (I'm using FileAppder, and the file is
>> not created).
>>
>> this is my config file:
>> <configuration>
>>     <appender
>>         name="userClicksAppender"
>>         class="ch.qos.logback.core.FileAppender" >
>>         <file>
>>  /sdcard/Test/data/log.txt
>>         </file>
>>         <append>
>>  true
>>         </append>
>>         <encoder class="com.android.gooapplication.model.MyEncoder" >
>>             <pattern>
>> %-4relative [%thread] %-5level %logger{35} - %msg%n
>>             </pattern>
>>         </encoder>
>>     </appender>
>>     <logger name="userClicksLogger" >
>>         <appender-ref ref="userClicksAppender" />
>>     </logger>
>> </configuration>
>>
>> I tried to skip the class MyEncoder and the whole packages of logback in
>> the proguard config file as follows:
>> -keep public class com.android.gooapplication.model.MyEncoder
>> -keep public class ch.qos.logback.**
>> -keep public public class org.slf4j.**
>>
>> but still with no success.
>>
>> what do you think?
>> Many thanks,
>> Omer.
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130227/0cae62f8/attachment.html>


More information about the Logback-user mailing list