Kudze

Log files

Recommended Posts

Kudze    0

Hello I have really small server side suggestion for 0.2.

I think you should add log files in which all console output would be logged. This would help server owners to faster diagnose what went wrong in their scripts and why their server crashed.

Share this post


Link to post
Share on other sites
kemperrr    125

This can be done in 0.1

 

process.stdout.wr = process.stdout.write;
process.stdout.er = process.stderr.write;

process.stdout.write = (mes, c) => {
  fs.appendFile('log.log', mes, (err) => {
    if (err) throw err;
  });
  process.stdout.wr(mes, c)   
};

process.stderr.write = (mes, c) => {
  fs.appendFile('log.log', mes , (err) => {
    if (err) throw err;
  });
  process.stdout.er(mes, c)   
};

 

  • Like 3

Share this post


Link to post
Share on other sites
Armyw0w    23

instead of writing and writing the log file again and again, why don't store that logs in a mysql temp table and at server exit just write the log file?

#morefaster

Share this post


Link to post
Share on other sites
kemperrr    125
9 часов назад, Armyw0w сказал:

instead of writing and writing the log file again and again, why don't store that logs in a mysql temp table and at server exit just write the log file?

#morefaster

I find it easier to look at a file

Share this post


Link to post
Share on other sites
Armyw0w    23
On 18.06.2017 at 11:08 PM, kemperrr said:

I find it easier to look at a file

so you cant look in the console? just saying.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.