Code Monkey home page Code Monkey logo

logrus_zinc's Introduction

Logrus Zinc

This is a hook for use with the amazing ZincSearch just in case anyone wanted to not have to run an entire elastic + kibana cluster locally.

Adding to your Logrus logger

  1. go get github.com/lindgrenj6/logrus_zinc
  2. All of the logic is contained in the LocalZincHook struct - so adding a call like this should be enough:
logger.AddHook(&LocalZincHook{
    URL: "http://localhost:4080,
    Index: "myapp",
    Username: "admin",
    Password: "changeme",
})

note: URL will default to localhost:4080 and index will default to...default. so they are not required

  1. After that just run the program like normal and your logs should be geting shipped to your local zinc instance. Sweet!

Just browse to http://localhost:4080 and you will see a lightweight verion of the Kibana UI we're all used to.

Running Zinc

I usually run zinc with podman, but docker will work fine too. Run an ephemeral instance of zinc using this command:

mkdir -p /tmp/zincdata && chmod 777 $_

/usr/bin/podman run \
        -it --rm \
        -v /tmp/zincdata:/data \
        -e ZINC_DATA_PATH=/data \
        -e ZINC_FIRST_ADMIN_USER=admin \
        -e ZINC_FIRST_ADMIN_PASSWORD=changeme \
        -p 4080:4080 \
        --name zinc \
        -it public.ecr.aws/zinclabs/zinc:latest

and there will be a new zinc instance running on your localhost using the credentials provided.

if there are any issues, here are the amazing zinc docs for installation: https://docs.zincsearch.com/installation/

logrus_zinc's People

Contributors

lindgrenj6 avatar

Watchers

 avatar  avatar  avatar

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.