We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#18 seems to have been broken along the way.
require('dotenv').config(); const winston = require('winston'); const LogstashTransport = require("winston-logstash/lib/winston-logstash-latest"); const os = require('os'); // Prepare logging const logger = winston.createLogger({ level: "debug", format: winston.format.combine(winston.format.simple(), winston.format.timestamp(), winston.format.colorize()), defaultMeta: { environment: process.env.NODE_ENV || "development", service: 'ephemeral', host: os.hostname(), version: require('./package.json').version, }, transports: [ new winston.transports.File({ filename: 'logs/error.log', level: 'error' }), new winston.transports.File({ filename: 'logs/combined.log' }), new winston.transports.Console(), ], }); if (process.env.LOGSTASH_HOST && process.env.LOGSTASH_PORT && process.env.LOGSTASH_HOST) { logger.info("Using Logstash"); logger.add( new LogstashTransport({ port: process.env.LOGSTASH_PORT, node_name: process.env.LOGSTASH_NODE_NAME, host: process.env.LOGSTASH_HOST, max_connect_retries: -1 }), ); } else { logger.info("Missing ENV variables to use Logstash"); } module.exports = { logger: logger }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
#18 seems to have been broken along the way.
The text was updated successfully, but these errors were encountered: