Stackdriver logs do not show
mynameisrufus opened this issue · 2 comments
This might not be an issue it could be me doing something incorrectly.
I have the following in /etc/google-fluentd/config.d/api.conf
:
<source>
@type tail
format none
path /opt/api/var/log/*.log*
pos_file /var/lib/google-fluentd/pos/api.pos
read_from_head true
tag structured-log
</source>
As per the guide here https://cloud.google.com/logging/docs/agent/configuration
With the following in my application config:
config :logger, backends: [LoggerJSON]
config :logger_json, :backend, json_encoder: Jason
With this configuration the log message is in textPayload
as expected however if I change format in the fluentd conf file from format none
to format json
the logs never arrive 🤷♂️
@mynameisrufus I'm not sure how to configure standalone fluentd worker to integrate with Stackdriver, can only tell that we use LoggerJSON
in staging and production Kubernetes clusters on GKE and they work without changing any fluentd configuration.
@AndrewDryga thanks for the reply. I'm will log text for now as I don't actually need structured logs it would just have been nice to have.