Production Troubleshooting using Log infrastructure


Hi All,

I’m soon to deploy my meteor app to production for the first time. I’m new to meteor and web development generally, so I wonder how to troubleshoot production issues.
The systems I built in the past were using a sophisticated log infrastructure which allowed us to reproduce the user’s flow that caused the issue and therefore troubleshoot the problem fast.

However, I saw no reference to logging it in the meteor guide. I find it hard to believe that there is no builtin logging activity at the server side, at least for DDP transportation.

Am I missing something, but if not, how do you troubleshoot production issues? Which logging system do you use?

Best regards,


That depends on two main factors:

  • Lightweight logging, such as exception handling and tracing can be handled on Mongo as a separate collection.
  • Tracebacks, status management, etc (Heavyweight logging), better use a local / cloud file system for this.

There is no pre-built logging solution for Meteor, but also remember Meteor is a NodeJS app and unless you’re working with <1.3 versions then you can make use of NPM packages that best suit your needs.

In my case, I use log4JS and avoid logging into database as that will decrease overall performace and availability.

In general, logging is an architecture design, which means it’s purpose specific.

My recommendation would be to build a Logger controller yourself that you can import into each specific method and is able to monitor Method arguments and state, something like this:

// on Method declaration
    if(!this.userId){  throw new Meteor.Error('Not authorized') }
    const loggerComposite = new Logger('');
    // For sensitive methods, use a try / catch
          // Logic goes here
    } catch(err) {
        // Handle error on method as you please
    } finally {

Try catch block is pretty useful, and will only show a performance impact when used on extremely demanding method calls (something like +500 ms per 20’000 calls, you can test it with a loop yourself).

The idea behind is to allow your Logger controller to format things as you need it, either save a JSON file such as:

   status: success / fail;
   date: new Date(),
   method: '',
   userId: 'USERID',
   arguments: [...args],
   success: null || result,
   error: error.message

Otherwise you can also use a logger to handle all functionality behind the curtain and just replace the usage you have with console.log:

const logger = new LoggerController();
logger.log('debug', this.userId);
logger.log('info', this.userId);
logger.log('error', this.userId);

This last method will emulate a raw log output, compatible with any unstructured file type you want (txt, csv, etc.)
The former has a more report-like approach, which can be latter processed in UNIX / node, etc. as you want.

Just remember, don’t clog your mongo process or your reactivity will be impacted.

There used to be a service called Kadira which logged permormace on Meteor methods, it’s been opensourced and taken down for a number of reasons (see end of transmission). You can set your standalone performance monitor here:


Thanks for the detailed response. I need to dive into the details you specified, there is a lot of information there I need to process.
Thanks again.