Slow Start due to org.eclipse.jetty.util.log.Slf4jLog Logger initialization
Hi, I'm using micronaut framework with the function-maven-plugin. Running the function locally and also on a real gcp function the logger takes a lot of time to initialize. I'm using sl4j (coming from micronaut)
Here is a log from my machine, more than 3 seconds only to setup the logger.. and the remaining micronaut initialization always takes less than 0.5seconds.
[INFO] Logging initialized @3146ms to org.eclipse.jetty.util.log.Slf4jLog
Same thing happens in a real GCP function environment, but the overall start time depends on the function memory
We're experiencing the same issue and found this ticket from google. :)
16:18:14.892 | I | main | org.eclipse.jetty.util.log | Logging initialized @19402ms to org.eclipse.jetty.util.log.Slf4jLog
Yes, you've read it correctly - it takes about 20 SECONDS! :D
However, I don't think this is related to the functions-framework-java project per say - it's probably a bug in jetty or Slf4jLog since we're not using functions-framework-java (or GCP at all for the moment)
I don't know for sure, but often scanning the classpath on startup or trying to make an external connection causes these kind of slowdowns. I'd recommend checking the logger's configuration to see if it's using default options that are causing it to be slow.
Since this doesn't seem to be directly related to the functions framework I'm going to close the issue, but don't hesitate to re-open it if you find out otherwise.