Skip to content

toorop/ovhlogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ovhlogger

pipe STDIN to OVH Logs Data Platform

echo "Hello ovh log" | ovhlogger

How to use it

download binary

Download the appropriate binary for your platform, from releases menu above.

rename it

mv ovhlog_version_platform ovhlogger

set environment variables

You need to set:

  • OVHLOGGER_LOGLEVEL: log level
  • OVHLOGGER_PROTO:
    • udp: udp
    • tcp: tcp
    • tls: tcp + TLS
  • OVHLOGGER_ENDPOINT: for example gra1.logs.ovh.com
  • OVHLOGGER_TOKEN: you stream write token

*nix example:

export OVHLOGGER_LOGLEVEL=6
export OVHLOGGER_PROTO=udp
export OVHLOGGER_ENDPOINT=gra1.logs.ovh.com
export OVHLOGGER_TOKEN=af97a14a-010b-4ce9-9e5a-dsfdsfsd

that it !

ovhlogger will read from STDIN, push each line to OVH logs platform and write it to STDOUT

$ echo "hello ovh logs" | ovhlogger
hello ovh log

You can use it with any process wich log to stdout.

Example with systemd init script

[Unit]
Description=ipfs.toorop.fr
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
Restart=on-failure
StartLimitInterval=86400
StartLimitBurst=5

; ENV var for ovhlogger
Environment=OVHLOGGER_LOGLEVEL=6
Environment=OVHLOGGER_PROTO=udp
Environment=OVHLOGGER_ENDPOINT=gra1.logs.ovh.com
Environment=OVHLOGGER_TOKEN=xxx-dddd-aaaa-zzzz-xxxxx

; User and group the process will run as.
User=www-data
Group=www-data
WorkingDirectory=/var/www/ipfs.toorop.fr/bin                     

ExecStart=/var/www/ipfs.toorop.fr/bin/server | /usr/bin/ovhlogger
ExecReload=/bin/kill -USR1 $MAINPID

[Install]
WantedBy=multi-user.target

About

pipe STDIN to OVH Logs Data Platform

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages