Giter Club home page Giter Club logo

Comments (5)

alexc-hollywood avatar alexc-hollywood commented on July 1, 2024 1

@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,
        ],

from seq-input-gelf.

alexc-hollywood avatar alexc-hollywood commented on July 1, 2024 1

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).

from seq-input-gelf.

larenelg avatar larenelg commented on July 1, 2024

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

from seq-input-gelf.

alexc-hollywood avatar alexc-hollywood commented on July 1, 2024

@larenelg Thanks for the comprehensive and speedy response! Let me run it and see. Going to have a happy dev team if it does!

from seq-input-gelf.

larenelg avatar larenelg commented on July 1, 2024

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

from seq-input-gelf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.