Help with setting up papertrail logging

argon
Tags: #<Tag:0x00007fe225eebf10>

#1

Trying to setup papertrail log tracking without success. I have setup the papertrail account and used the code below :

#include "papertrail.h"

PapertrailLogHandler papertailHandler("logsx.papertrailapp.com", xxxxx, 
    "aqm_argon",  System.deviceID(),
    LOG_LEVEL_NONE, {
        {"app", LOG_LEVEL_ALL},
        {"System", LOG_LEVEL_ALL}
    });

Do I have to do anything else to send all Serial.print and Serial.println commands?


#2

Serial.print() commands will always end up on the USB Serial port.
LogHandlers only apply to Log.xxx() calls.


#3

How can I send all error messages and maybe some system initialization messages to the papertrail log? Browsed around quite a bit and checked out the papertrail exmaples but still not sure.


#4

That depends on how these are produced. When they are created correctly they will end up at the log handler(s) automatically. If not, then you have to change how you produce these messages.

These are by default channeled to all instantiated log handlers.


#5

I added the following (besides the code above):

just outside my loop:

int i = 0;

and to my loop

Log.info("Log message #%d", ++i);

Still nothing …


#6

To test your logging you may want to also instantiate a SerialLogHandler and see whether the desired info turns up there at least.

And for completeness, of course your Argon needs to be connected to the internet to for Papertrail to work and depending on your SYSTEM_MODE and SYSTEM_THREAD maybe even to the Particle cloud.


#7

My argon is using the ethernet featherwing. I assume I dont need to use system_mode and system_thread? Its sending data to particle cloud ok.