Logging using External Services (Cloudwatch, DataDog etc...)

I’m returning to the logging question after not being successful in my last attempt.

I notice this section of the Parse Server Docs, however I cannot find any detailed instructions on implementing this.

For example, we have our ParseServer initiation:

const api = new ParseServer({
...
databaseURI: localhost, 
jsonLogs: true, 
});

However, next steps for these logs to be returned to a service such as CloudWatch are pretty difficult.

In the same way as file / email adapters are offered, could we work on offering adaptors to some of the popular cloud services and include them in the ParseServer docs. I expect that logging a cloud service is going to be a requirement for many who are deploying Parse Server in a Prod env.

My question is two fold:

  1. Can any support be offered on how to log using CloudWatch, DataDog, Google Cloud Logging or other service.
  2. I propose the development of this solution is included in the docs, which I am happy to do if anyone has any detailed information on how to build a robust logging solution using one of the aforementioned services.

In order to log in these services, you will need to create a new LoggerAdapter and set in your Parse Server configuration.

Hi @davimacedo, thanks for your reply. Yep, This is as you mentioned in my last post, however I’m unsure how to do this and guidance on this when looking around the web is pretty sparse.

Do you have an example, or willing to work on an example of this? I figured it would be a good piece of information to add to the ParseServer docs once I’ve successfully implemented it, something I am happy to open a PR for if someone can help on the logging adaptor side.

I think that, before any documentation, you’d need to create the adapter (I am not aware of any open source logger adapter for these services). It is an adapter that requires only a single function to be written. Give it a try and we will be happy to review a PR or you can even deploy it in a new repository under your own account. You can also use the WinstonLoggerAdapter as a reference for that. If you have any specific question, I will be happy to help.

@davimacedo let me know what you think to this… working well for me so far

1 Like

Nice. It’s a great job! I’d recommend only publishing it to npm so people could install from there instead of copying the code. Then you can also open a PR to https://parseplatform.org/ in order to list your new adapter to the Parse Server Adapters section.

I cannot take the credit for this, it was someone I asked to do it. I’ve never published anything to NPM before so I will take a look at that as soon as I have some time.

1 Like