Closed alexc-hollywood closed 4 years ago
Hi @azcoppen
Thanks for getting in touch, and for the detailed information! I was able to reproduce your issue.
The reason why seq-input-gelf
cannot see seq
is because is not on one of the networks, frontend
or backend
.
I listed backend
as one of the networks under seq-input-gelf
and it resolved the issue.
Please let me know, or close this issue, if this also fixes it for you!
Here is my docker-compose.yml
for reference :)
version: '3'
services:
seq-input-gelf:
image: datalust/seq-input-gelf:latest
depends_on:
- seq
environment:
GELF_ADDRESS: "tcp://0.0.0.0:12201"
SEQ_ADDRESS: "http://seq:5341"
GELF_ENABLE_DIAGNOSTICS: "True"
ports:
- "12201:12201"
networks:
- backend
restart: unless-stopped
seq:
container_name: seq
image: datalust/seq:latest
restart: unless-stopped
environment:
- ACCEPT_EULA=y
ports:
- "9595:80"
- "5341:5341"
networks:
- frontend
- backend
networks:
frontend:
backend:
Cheers, Larene
@larenelg Thanks for the comprehensive and speedy response! Let me run it and see. Going to have a happy dev team if it does!
@larenelg You're a legend. Had to switch the default host from '127.0.0.1' to 'seq-input-gelf' though when using docker. Would be great to have a Monolog plugin for the Seq HTTP API. Most devs i know use an external SaaS (pricey) or Graylog (requires Mongo and Elastic).
For others who are looking to implement this, had to make some changes to config/logging.php
, so here is the full snippet:
'seq' => [
'driver' => 'custom',
'via' => \Hedii\LaravelGelfLogger\GelfLoggerFactory::class,
'processors' => [
\Hedii\LaravelGelfLogger\Processors\NullStringProcessor::class,
],
'level' => env('GELF_MIN_LEVEL', 'debug'),
'name' => env('GELF_CHANNEL', 'your-app-name'),
'system_name' => env('GELF_SOURCE', 'laravel'),
'host' => env('GELF_HOST', '127.0.0.1'), // 'seq-input-gelf' when dockerised, not localhost
'port' => env('GELF_PORT', 12201),
'path' => env('GELF_HTTP_PATH', null),
'max_length' => null,
'context_prefix' => null,
'extra_prefix' => null,
],
Thanks for sharing that config @azcoppen - I hope you don't mind if we add a "logging from Laravel" section in our docs with similar config as an example (with due credit, of course!). It's been a while since I've built something using Laravel :)
RE: a Monolog plugin - bandwidth is a little thin on our team at the moment, but it does sound worthwhile! I might have a go at it myself, but if you are feeling like dabbling, here's an easy-to-follow tutorial on how to make a custom Seq Input Apps :) https://docs.datalust.co/docs/writing-custom-inputs
Be my guest! It's a bit thin on the ground in terms of docs tbh. This was the only package i found, but it's abandoned: https://github.com/msschl/monolog-seq-handler
I don't want to have to install Mongo/ES for Graylog - we need a nice team solution where we can watch API clients in real time, not have to SSH in for logs, and not send data across the net (even queued).
It makes it a whole new thing IMO. Particularly as you can log to the same place from different types of apps (e.g. Electron, Django, NoSQL DB etc).
Attempting to send errors from Laravel framework through its Logging engine as GELF to Seq.
Docker compose setup:
Ports are up:
Docker ps:
Container:
This works and appears in Seq.
This returns fine but does not appear in Seq (no STDOUT either, nothing when listening on the port, no error):
Attempting to use this package: https://github.com/hedii/laravel-gelf-logger also fails.
config/logging
in Laravel:Logs from Seq (no errors)
From within the container:
Logs from seq-input-gelf: