Merge remote-tracking branch 'syslog/master'
Merge cloudron-syslog code here
This commit is contained in:
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
'use strict';
|
||||
|
||||
const server = require('./server.js');
|
||||
|
||||
const argv = require('yargs')
|
||||
.default('port', 2514, 'The port to listen on') // syslog is 514 so we prefix with 2
|
||||
.default('logdir', '/tmp/logs', 'The root log directory')
|
||||
.argv;
|
||||
|
||||
const options = {
|
||||
logFolder: argv.logdir,
|
||||
port: argv.port
|
||||
};
|
||||
|
||||
if (argv.version) {
|
||||
console.log('1.0.1');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
console.log();
|
||||
console.log('==========================================');
|
||||
console.log(' Cloudron Syslog Daemon ');
|
||||
console.log('==========================================');
|
||||
console.log();
|
||||
console.log(' Log Folder: ', options.logFolder);
|
||||
console.log(' UDP Port: ', options.port);
|
||||
console.log();
|
||||
console.log('==========================================');
|
||||
console.log();
|
||||
|
||||
server.start(options, function (error) {
|
||||
if (error) return console.error(error);
|
||||
console.log('Listening...');
|
||||
});
|
||||
Reference in New Issue
Block a user