mathew-kurian / Scribe.js

:scroll: Node.js logging made simple! Online access to logs and more...
https://mathew-kurian.github.io/Scribe.js/
MIT License
284 stars 45 forks source link

Forwarded: Scribe.Js - Quick Question #28

Closed mathew-kurian closed 8 years ago

mathew-kurian commented 9 years ago

First of all. Thanks a lot for the wonder logging tool. Got a quick question. When I attach the logger to express logger. For every request I get logs with tags like Method, Req IP, etc. I want to automatically add those tags to each log even when a developer forgets to do .tag(). Is it possible to have global default tags. Please let me know.

Also what is your scribe-based recommendation if my app runs in multiple nodes with multiple clusters in each node.

--Anonymous

guillaumewuip commented 9 years ago
var console  = scribe.console({
    console : {
        defaultTags : ['My default tags', {msg : 'custom default tag', color : 'inverse'}]
    }
});

// or 

console.addLogger('logger', 'red', {
    defaultTags : ['My default tags', {msg : 'custom default tag', color : 'inverse'}]
});

//and then

console.logger('My message'); //will print the 2 default tags too

This could be an enhancement.

guillaumewuip commented 9 years ago

Do we have some news from anonymous ?

The default tags feature is implemented in #32

mathew-kurian commented 9 years ago

@guillaumewuip Thanks for the push! He has been informed. He doesn't have a git account so I posted it here. Also, I just got busy with some work but I will be working on his multithreaded logging soon; lets leave the issue open until that feature is added as well.

mathew-kurian commented 9 years ago

40