Skip to content
New issue

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

allow custom log file name #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ if (argv.help) {
'--help Display this help message and exit',
'--port <port> The port to listen on (default: 4567)',
'--path <path> The path to use for the LevelDB store (in-memory by default)',
'--logFileName The file name of the log',
'--ssl Enable SSL for the web server (default: false)',
'--createTableMs <ms> Amount of time tables stay in CREATING state (default: 500)',
'--deleteTableMs <ms> Amount of time tables stay in DELETING state (default: 500)',
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function dynalite(options) {
options = options || {}
var server, stores = {}, requestHandler = httpHandler.bind(null, stores, options)

logger = dynaliteLogger.createLogger("dynalite_log", __dirname, options)
logger = dynaliteLogger.createLogger(__dirname, options)

if (options.memoryStats) {
setInterval(function() {
Expand Down
4 changes: 2 additions & 2 deletions logger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports.getInstance = getInstance
var instance;

// Public
function createLogger (name, defaultPath, opts) {
function createLogger (defaultPath, opts) {
if (!opts.verbose) {
instance = {
info:function() {},
Expand All @@ -25,7 +25,7 @@ function createLogger (name, defaultPath, opts) {

var dataDirectory = opts.path ? opts.path : defaultPath // If we're not in-memory use the same directory for logs.
var logsDirectory = getValidLogDirectory(dataDirectory);
var fullPath = path.join(logsDirectory, getLogFileName(name));
var fullPath = path.join(logsDirectory, getLogFileName(opts.logFileName || "dynalite_log"));

instance = new (winston.Logger)({
transports: [
Expand Down