0.0.2 • Published 7 years ago

hubot-graylog-adapter v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

hubot-graylog-adapter

npm version Build Status

Graylog logging adapter for Hubot

Installation

  • Run the npm install command
npm install hubot-graylog-adapter --save
  • Add hubot-graylog-adapter to the array in your external-scripts.json file.
[
  "hubot-graylog-adapter"
]
  • Configure environment variables
Environment VariableRequiredDescriptionExample
HUBOT_GRAYLOG_ADAPTER_HOSTNAMEYesHostname/IP of Graylog servergraylog.example.com
HUBOT_GRAYLOG_ADAPTER_PORTnoGELF port number of Graylog server (default: 12201)12201
HUBOT_GRAYLOG_ADAPTER_FACILITYno'facility' attribute for log messages (default: hubot)hubot
HUBOT_GRAYLOG_ADAPTER_APPNAMEno'app' attribute for log messages (default: hubot)hubot
HUBOT_GRAYLOG_ADAPTER_ENVIRONMENTno'env' attribute for log messages (default: development)development
HUBOT_LOG_LEVELnoHubot logging level (default: info)info

Usage

Use the robot.logger methods in your hubot scripting, and your messages will be sent to the console as well as Graylog.

  module.exports = (robot) ->
   robot.hear /knock knock/i, (msg) ->
     robot.logger.info "Someone is telling a joke!"
     msg.send "Who is there?"

Supported robot.logger levels:

robot.logger.emergency "Graylog logger!"
robot.logger.alert "Graylog logger!"
robot.logger.critical "Graylog logger!"
robot.logger.error "Graylog logger!"
robot.logger.warning "Graylog logger!"
robot.logger.notice "Graylog logger!"
robot.logger.info "Graylog logger!"
robot.logger.debug "Graylog logger!"

Tests

To run the tests, run the below command. If you are contributing, please add appropriate tests before submitting a pull request.

npm test

Acknowledgements

This project makes use of:

0.0.2

7 years ago

0.0.1

7 years ago