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

How to write a log line by line. #41

Open
Subramanian8 opened this issue Oct 30, 2018 · 1 comment
Open

How to write a log line by line. #41

Subramanian8 opened this issue Oct 30, 2018 · 1 comment

Comments

@Subramanian8
Copy link

Subramanian8 commented Oct 30, 2018

It create a file and write a log. everything is working.
The problem is log written in single line. but, i need to write every log in separate line.

My log file:
2018-10-30 04:48:43 INFO Start 2018-10-30 04:48:53 INFO Model Page : User id - TEST12345 2018-10-30 04:48:56 INFO Dashboard Page : setmodel 2018-10-30 05:26:50 INFO About Page : setmodel

Expected output:
2018-10-30 04:48:43 INFO Start
2018-10-30 04:48:53 INFO Model Page : User id - TEST12345
2018-10-30 04:48:56 INFO Dashboard Page : setmodel
2018-10-30 05:26:50 INFO About Page : setmodel

Code:

logfile_opts = {
logDirectory:'logs', // NOTE: folder must exist and be writable...
fileNamePattern:'pheal-.log',
timestampFormat:'YYYY-MM-DD HH:mm:ss'
}

const logger = require('simple-node-logger').createRollingFileLogger( logfile_opts );
// const log = require('simple-node-logger').createSimpleLogger();

logger.info('Start');
logger.info('Model Page : User id - TEST12345');
logger.info('Dashboard Page : setmodel');
logger.info('About Page : setmodel');

@E-P1983
Copy link

E-P1983 commented Nov 12, 2018

Same here. I expect it to be something with the Unix environment since its working on the windows testing environment. Anybody got a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants