-
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
Logging Handler Should Have Fluentd Transport #1130
Comments
Hi @waprin, you mean having a JUL handler that logs entries to fluentd? While this is surely a "nice-to-have" (I am surprised it does not exist yet) I doubt that |
Yep that's what I meant. Both GAE Flexible and GKE install the logging agent and it's one of the main ways we recommend communicating with logging API (though having an option to just use the API directly is also good). I personally think it does belong in the gcloud-* libraries but opinions in general seemed mixed and might be decided on a per-language basis. Just wanted it on the radar. |
If I understood correctly such a handler should serve as a way to direct log entries produced with JUL to fluentd. Even though I see it could be used in both GAE and GKE, such a handler is not directly related to Stackdriver Logging. In fact, it could be also useful in circumstances where fluentd is used with a different target. I would imagine this is something fluentd people might be interested in providing users with. For this reason I believe that gcloud-java is not the best place for this bridge between JUL and fluentd. |
It is related because on GAE and GKE, there is a special file /var/log/app_engine/app.log.json along with a certain structured format necessary to get logs to show up correctly. Take a look at: https://github.com/GoogleCloudPlatform/winston-gae/blob/master/lib/winston-gae.js I understand what you're saying, but I'm not proposing a generic fluentd JUL handler, which doesn't make sense anyway since fluentd is an agent that can read from any file. What I'm proposing is a handler that writes to the files in a way that the default fluentd agent that we direct users to install here: https://cloud.google.com/logging/docs/agent/installation will correctly pick up log levels, etc. Currently if you just write to standard out on GAE Flex the fluentd agent does actually pick it up but because of this lack of structure does not capture log levels. See pissed off customer here: |
Also if you read the answer to that StackOverflow question, the log levels are captured correctly only in the 'compat' runtime, because someone actually did this work in this runtimes so log work as expected, but really it should work in the vanilla runtime as well, but being 'vanilla' we have to ask users to instrument some sort of client library to do so. As you can see, NodeJS created a whole repo just for that one tiny piece of code, which is an opinion thing as mentioned but I personally think it makes sense to include some of that code here. |
Bill - would https://github.com/fluent/fluent-logger-java help us in any way? Or this |
BTW - I'm asking that all supported Java Frameworks including logging correctly, like java-compat. |
@jabubake is this being actively worked on or still in 'nice-to-have' bucket? If latter, I'd like to move to our feature backlog and close this issue. Thanks! |
@danoscarmike : 'nice-to-have' |
Thanks @jabubake! This has been added to our feature backlog: https://github.com/GoogleCloudPlatform/google-cloud-java/wiki/Feature-backlog. This issue will be closed but is linked in the backlog and can continue to be used for comment and discussion. |
…googleapis#529) This prevents processing the unexpanded glob "**/.flattened-pom.xml" in repos which do not flatten any POMs. Source-Link: googleapis/synthtool@87254ac Post-Processor: gcr.io/repo-automation-bots/owlbot-java:latest@sha256:a9b83a276c82987d284b733713fe86a3c8a2cc457933767eeb2688b882e54c6a
🤖 I have created a release \*beep\* \*boop\* --- ### [0.119.8](https://www.github.com/googleapis/java-resourcemanager/compare/v0.119.7...v0.119.8) (2021-07-05) ### Bug Fixes * Add `shopt -s nullglob` to dependencies script ([googleapis#1130](https://www.github.com/googleapis/java-resourcemanager/issues/1130)) ([googleapis#529](https://www.github.com/googleapis/java-resourcemanager/issues/529)) ([bc73cf0](https://www.github.com/googleapis/java-resourcemanager/commit/bc73cf0344cdda3ad6bdf887b91c51fb4cb5d578)) ### Dependencies * update dependency com.google.apis:google-api-services-cloudresourcemanager to v1-rev20210613-1.31.5 ([googleapis#528](https://www.github.com/googleapis/java-resourcemanager/issues/528)) ([e04ae17](https://www.github.com/googleapis/java-resourcemanager/commit/e04ae171f3fe5f299788c412138aff09596129ff)) * update dependency com.google.apis:google-api-services-cloudresourcemanager to v1-rev20210613-1.32.1 ([googleapis#538](https://www.github.com/googleapis/java-resourcemanager/issues/538)) ([b7d0ec6](https://www.github.com/googleapis/java-resourcemanager/commit/b7d0ec6bf4f29ba80f2b49fc89f5d3fea105c640)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([googleapis#537](https://www.github.com/googleapis/java-resourcemanager/issues/537)) ([21eb516](https://www.github.com/googleapis/java-resourcemanager/commit/21eb516f853ed8e5adca0b7d7a8c0c5e1621933e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This prevents processing the unexpanded glob "**/.flattened-pom.xml" in repos which do not flatten any POMs. Source-Link: googleapis/synthtool@87254ac Post-Processor: gcr.io/repo-automation-bots/owlbot-java:latest@sha256:a9b83a276c82987d284b733713fe86a3c8a2cc457933767eeb2688b882e54c6a
🤖 I have created a release \*beep\* \*boop\* --- ### [1.0.2](https://www.github.com/googleapis/java-workflows/compare/v1.0.1...v1.0.2) (2021-07-01) ### Bug Fixes * Add `shopt -s nullglob` to dependencies script ([#1130](https://www.github.com/googleapis/java-workflows/issues/1130)) ([#286](https://www.github.com/googleapis/java-workflows/issues/286)) ([2101cc5](https://www.github.com/googleapis/java-workflows/commit/2101cc52ff37168707b9b91719356eccea5437b5)) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#288](https://www.github.com/googleapis/java-workflows/issues/288)) ([2dd7b14](https://www.github.com/googleapis/java-workflows/commit/2dd7b1409e38745666e5b8aa179bc6f403dc460c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This might be a "nice-to-have", but a Java logging handler that logs by writing to the fluentd handler could be helpful. Biggest consideration here is whether it would perform better than the current one. fluentd is installed on App Engine flexible and can be included in GKE clusters with click of a button so it's good to integrate with it.
The text was updated successfully, but these errors were encountered: