2

Tell me whether it is possible to make a separation by severity in stackdriver. All messages in the container are displayed in stderror and in stackdriver, they are marked as errors. The task is to separate messages from logs (laravel) into categories information, error, warning.

Google Kubernetes Engine + Stackdriver logging enabled.

James M
  • 200
  • 1
  • 2
  • 12
  • You can query based on a key string, but this is not how it is designed to work Laravel should be classifying the logs correctly, if it's not, show us an example of how the logs are being displayed. The PHP should be showing the logs in the correct categories, if it's not, please take a look here: https://cloud.google.com/logging/docs/setup/php and here:https://cloud.google.com/error-reporting/docs/setup/php – Will R.O.F. Feb 28 '20 at 16:42
  • James, did you checked the info? an example of how the logs are being shown will be of great help. – Will R.O.F. Mar 04 '20 at 09:40
  • this is not what i need. looks like best way is setup fluentd + fluent-plugin-google-cloud. fluentd must be as DaemonSet – James M Mar 06 '20 at 08:40
  • Consider writing an answer to provide the information on how you achieved this to help the community! – Will R.O.F. Mar 06 '20 at 16:18
  • @JamesM did you solve it? – Mr.KoopaKiller Aug 18 '20 at 09:05
  • 1
    @KoopaKiller yes. we added plugin for our laravel app which formatting output and send to stackdriver. but now we collecting logs in ELK with alerting. In our case this much better then stackdriver. – James M Aug 18 '20 at 10:55
  • The plugin you said is that: https://github.com/GlueDev/laravel-stackdriver ? – Mr.KoopaKiller Aug 18 '20 at 13:04
  • Hello. It looks like you've solved your issue first by adding a laravel plugin that formats and sends the data to Stackdriver. Then you opted to use ELK stack. As it looks like the issue is resolved please post the solution in the answer section for better visibility. – Dawid Kruk Nov 16 '20 at 17:32
  • sorry guys i don't remember what the plugin developers added to laravel. but I remember that after they did that we just set up the format for the fluentd logs for the importance of the logs (json format) and after that the logs included in google fluend (old name is stackdriver logging agent) with stage markers severities are now displayed correctly. And we don't using Elastic or ELK stack. – James M Feb 15 '21 at 17:03

1 Answers1

0

Posting this Community Wiki for better visibility as OP was able to solve this issue in comment section.

Best solution for OP was to add plugin for laravel application which is sending to stackdriver output with proper formatting. Second part was to configure ElasticSearch with adjusted alerting rules.

Another solution which would fit to other scenario is to use fluentd with fluent-plugin-google-cloud.

PjoterS
  • 615
  • 3
  • 11