Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The release version turns on minifyEnabled, and the file name is printed as null. <pattern>[%date] [%file:%line] - %msg%n</pattern> #364

Open
3 tasks done
StriId opened this issue Mar 2, 2024 · 0 comments
Assignees

Comments

@StriId
Copy link

StriId commented Mar 2, 2024

Describe the bug

[%date] [%file:%line] - %msg%n
log:
[2024-03-02 12:33:04,731] [null:4] - onDestroyView
[2024-03-02 12:33:04,734] [null:4] - onDestroy
[2024-03-02 12:33:04,736] [null:7] - onDestroy()
[2024-03-02 12:33:04,919] [null:21] - onResponse res

Reproduction

[2024-03-02 12:33:04,919] [null:21] - onResponse res

Logs

[2024-03-02 12:33:04,192] [null:4] - onStart
[2024-03-02 12:33:04,193] [null:7] - onPause()
[2024-03-02 12:33:04,724] [null:4] - onStop
[2024-03-02 12:33:04,725] [null:7] - onStop()
[2024-03-02 12:33:04,729] [null:27] - InitActivityDestroyed
[2024-03-02 12:33:04,731] [null:4] - onDestroyView
[2024-03-02 12:33:04,734] [null:4] - onDestroy
[2024-03-02 12:33:04,736] [null:7] - onDestroy()

logback-android version

3.0.0

OS Version

12

What logback configuration are you using? (logback.xml or Java/Kotlin code)

<appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <!-- active log file -->
        <!--                <file>${LOG_DIR_ERROR}/app_error_log.txt</file>&ndash;&gt;-->
        <!--        <encoder>-->
        <!--            <pattern>%date [%thread] %-5level %logger{36} [%file:%line] - %msg%n</pattern>-->
        <!--        </encoder>-->
        <encoder>
            <pattern>[%date] [%file:%line] - %msg%n</pattern>
        </encoder>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- daily rollover period -->
            <fileNamePattern>${LOG_DIR_ERROR}/%d.txt</fileNamePattern>
            <!-- keep 30 days' worth of history -->
            <maxHistory>3</maxHistory>
        </rollingPolicy>
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>ERROR</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
    </appender>

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants