loggly-appender.js 610 B

123456789101112131415161718192021222324
  1. //Note that loggly appender needs node-loggly to work.
  2. //If you haven't got node-loggly installed, you'll get cryptic
  3. //"cannot find module" errors when using the loggly appender
  4. var log4js = require('../lib/log4js');
  5. log4js.configure({
  6. "appenders": [
  7. {
  8. type: "console",
  9. category: "test"
  10. },
  11. {
  12. "type" : "loggly",
  13. "token" : "12345678901234567890",
  14. "subdomain": "your-subdomain",
  15. "tags" : ["test"],
  16. "category" : "loggly"
  17. }
  18. ]
  19. });
  20. var logger = log4js.getLogger("loggly");
  21. logger.info("Test log message");
  22. //logger.debug("Test log message");