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

Logging Handler Should Have Fluentd Transport #1130

Closed
waprin opened this issue Jul 25, 2016 · 10 comments
Closed

Logging Handler Should Have Fluentd Transport #1130

waprin opened this issue Jul 25, 2016 · 10 comments
Assignees
Labels
api: logging Issues related to the Cloud Logging API. priority: p2 Moderately-important priority. Fix may not be included in next release. triaged for GA type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@waprin
Copy link

waprin commented Jul 25, 2016

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.

@mziccard
Copy link
Contributor

mziccard commented Aug 8, 2016

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 gcloud-java is the right place for it.

@mziccard mziccard added the api: logging Issues related to the Cloud Logging API. label Aug 8, 2016
@waprin
Copy link
Author

waprin commented Aug 8, 2016

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.

@mziccard
Copy link
Contributor

I personally think it does belong in the gcloud-* libraries

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.

@waprin
Copy link
Author

waprin commented Aug 10, 2016

Even though I see it could be used in both GAE and GKE, such a handler is not directly related to Stackdriver Logging.

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:

http://stackoverflow.com/questions/37420400/how-do-i-map-my-java-app-logging-events-to-corresponding-cloud-logging-event-lev

@waprin
Copy link
Author

waprin commented Aug 10, 2016

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.

@lesv
Copy link
Contributor

lesv commented Aug 16, 2016

Bill - would https://github.com/fluent/fluent-logger-java help us in any way? Or this

@lesv
Copy link
Contributor

lesv commented Aug 16, 2016

BTW - I'm asking that all supported Java Frameworks including logging correctly, like java-compat.

@garrettjonesgoogle garrettjonesgoogle added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triaged for beta labels Dec 9, 2016
@michaelbausor michaelbausor added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Jul 7, 2017
@danoscarmike
Copy link
Contributor

@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!

@jabubake
Copy link
Contributor

jabubake commented Aug 9, 2017

@danoscarmike : 'nice-to-have'

@danoscarmike
Copy link
Contributor

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.

github-actions bot pushed a commit to suztomo/google-cloud-java that referenced this issue Jun 29, 2022
…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
github-actions bot pushed a commit to suztomo/google-cloud-java that referenced this issue Jun 29, 2022
🤖 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).
github-actions bot pushed a commit that referenced this issue Jul 1, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the Cloud Logging API. priority: p2 Moderately-important priority. Fix may not be included in next release. triaged for GA type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

7 participants