-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
LogbackAppender logging log doesnt show up in stackdriver #6437
Comments
Due to this, I am blocked. Please refer a workaround if possible. |
Hey @praveen4463 thanks for the report. With the given information I am unable to reproduce this issue. It may be possible that your logs are making it to Stackdriver and you are just not seeing them. There is an open issue when using the |
@praveen4463 I think this is happening bcz Logger is being reentrant when ever error occurs in the grpc itself while writing log entries. There is no clear solution as of yet, for you to move forward, you can update your logging configuration to use different logger like console or file based for this classes |
@codyoss @ajaaym Thanks for getting back. I applied configuration changes per @ajaaym, the thread dump now doesn't have references to those classes but the logs still aren't being logged.
And here is the latest thread dump
There is nothing else, I am using To guarantee that there is a problem, I had also tried changing the |
@praveen4463 Thanks for the reply. If it is not too much trouble do you think you could throw together a small example repo showing how to reproduce this? Given what you said I tried to boil it down to the following: package com.example.helloworld;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
public class HelloworldApplication {
Logger log = LoggerFactory.getLogger(HelloworldApplication.class);
@RestController
class HelloworldController {
@GetMapping("/")
String hello() {
log.error("Testing Logback error level standard");
return "Testing!";
}
}
public static void main(String[] args) {
SpringApplication.run(HelloworldApplication.class, args);
}
} My <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STACKDRIVER" class="com.google.cloud.logging.logback.LoggingAppender">
<log>app-zl-wzgp.log</log>
<flushLevel>INFO</flushLevel>
</appender>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<root level="INFO">
<appender-ref ref="STACKDRIVER" />
</root>
</configuration> Here is what I see in Stackdriver logs: Is there something different that you are doing to reproduce this? |
@codyoss Thank you for testing it. It turns out that my logs were loading correctly in stackdriver but with a resourceType that was unknown to me. I was checking them under I noticed that you used I added a resourceType to If you don't mind, just one more thing as we're on it. Today I added a Here is the implementation of
this remains the same even if I use a simple implementation like,
And here is the implementation of
Here is the LoggingAppender with enhancer in my logback.xml,
Would really appreciate if you shed some light over this, I'd prefer to use |
Glad I could help. I think this is what you are looking for. If you have further trouble feel free to open another issue. <loggingEventEnhancer>com.zylitics.wzgp.logging.DefaultLoggingEventEnhancer</loggingEventEnhancer> |
Environment details
I am using stackdriver Logback loggging but nothing is being logged. Upon getting the thread dump I found lots of threads are waiting indefinitely.
I searched issues and found similar ones that reported similar logs where threads have been waiting indefinitely,
LoggingAppender failure #3478
LoggingHandler hangs the thread #2796
And following seems to have fixed the issue long ago,
Logging: disable severity based flush on write by default #4254
But since the same issue is occurring, it doesn't seems to be fixed (atleast for
LogbackAppender
). The fix had set defaultflushSeverity
tonull
fromERROR
, but inLogbackAppeneder
, it is still set toERROR
. Even if we don't set aflushSeverity
,ERROR
level is default. I am referring to LogbackAppender.getFlushLevel, should the same fix be applied here?If I don't use
com.google.cloud.logging.logback.LoggingAppender
and write logs to console, it gets into stackdriver though (environment GKE).Below is the thread dump, threads seems to be waiting indefinitely.
The text was updated successfully, but these errors were encountered: