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

Azure function failed to log #61

Open
maksym-synkevych opened this issue Oct 11, 2019 · 8 comments
Open

Azure function failed to log #61

maksym-synkevych opened this issue Oct 11, 2019 · 8 comments

Comments

@maksym-synkevych
Copy link

maksym-synkevych commented Oct 11, 2019

Filed to log java-based Azure function using logback appender. Logging works properly when I'm running the application locally, but failed when trying to run it on Azure Function App environment with the following error:

2019-10-11T11:09:03.943 [Information] java.lang.IllegalStateException: Logback configuration error detected:
2019-10-11T11:09:03.943 [Information] ERROR in ch.qos.logback.core.joran.spi.Interpreter@14:16 - RuntimeException in Action for tag [appender] java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@4af18225 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@5283b3c5[Shutting down, pool size = 3, active threads = 0, queued tasks = 0, completed tasks = 2]

Full stacktrace available in here
logzio-appender.log.
Here is my configuration (real token replaced by "token" world):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
    <include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
    <shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>
    <appender name="LOGZIO" class="io.logz.logback.LogzioLogbackAppender">
        <token>token</token>
        <logzioUrl>https://listener-nl.logz.io:8071</logzioUrl>
        <logzioType>azure-function</logzioType>
    </appender>
    <root level="DEBUG">
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="LOGZIO"/>
    </root>
    <logger name="org.springframework.web" level="DEBUG"/>
</configuration>

@idohalevi
Copy link
Contributor

@maksym-synkevych It looks like the error is related to the logging fw. Can you try it with the console appender only and tell me if you have an issue or not?

@maksym-synkevych
Copy link
Author

maksym-synkevych commented Oct 15, 2019

@idohalevi Tried with only console appender (by commenting it) and it is also failed with following configuration.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
    <include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
    <shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>
    <appender name="LOGZIO" class="io.logz.logback.LogzioLogbackAppender">
        <token>token</token>
        <logzioUrl>https://listener-nl.logz.io:8071</logzioUrl>
        <logzioType>azure-function</logzioType>
    </appender>
    <root level="DEBUG">
        <appender-ref ref="CONSOLE"/>
    <!--    <appender-ref ref="LOGZIO"/>-->
    </root>
    <logger name="org.springframework.web" level="DEBUG"/>
</configuration>

But console logging works properly if I completely remove logzio configuration:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
    <include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
    <root level="DEBUG">
        <appender-ref ref="CONSOLE"/>
    </root>
    <logger name="org.springframework.web" level="DEBUG"/>
</configuration>

@idohalevi
Copy link
Contributor

@maksym-synkevych Please remove the token from the configuration sample.
Can you provide the logs for the error?

@maksym-synkevych
Copy link
Author

@idohalevi Updated previous message by removing the token.
You can see logs in attachments.
logzio-appender.log

@idohalevi
Copy link
Contributor

@maksym-synkevych Can you add the versions of the logback & logz.io appender? In addition, can you sure a snapshot of the project structure, specifically where is your logback.xml configuration and the naming of the files?

@maksym-synkevych
Copy link
Author

@idohalevi The version of logzio appender is 1.0.22
The project structure is following
image

@idohalevi
Copy link
Contributor

@maksym-synkevych Can you try the fix here? rename logback.xml to logback-spring.xml

@maksym-synkevych
Copy link
Author

@idohalevi Still failing with the same error:

2019-10-29T13:52:49.854 [Information] 2019-10-29 13:52:49.837 ERROR 9124 --- [pool-2-thread-2] o.s.boot.SpringApplication               : Application run failed
2019-10-29T13:52:49.854 [Information] java.lang.IllegalStateException: Logback configuration error detected:
2019-10-29T13:52:49.854 [Information] ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:16 - RuntimeException in Action for tag [appender] java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@62b08a6e rejected from java.util.concurrent.ScheduledThreadPoolExecutor@5a59fc85[Shutting down, pool size = 6, active threads = 0, queued tasks = 0, completed tasks = 3]
2019-10-29T13:52:49.854 [Information] at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:166)
2019-10-29T13:52:49.854 [Information] at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:79)
2019-10-29T13:52:49.854 [Information] at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:59)
2019-10-29T13:52:49.855 [Information] at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:117)
2019-10-29T13:52:49.855 [Information] at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:279)
2019-10-29T13:52:49.855 [Information] at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:254)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants