Use s3-streamlogger with DigitalOcean Spaces

Posted September 24, 2018 1.7k views

I am using s3-streamlogger along with DigitalOcean Spaces, and in order to create logs into my bucket I use the following code:

import { S3StreamLogger } from 's3-streamlogger';

const s3Stream = new S3StreamLogger({
  bucket: "mybucket",
  config: {
    endpoint: ''
  access_key_id: "MY_ACCESS_KEY",
  secret_access_key: "MY_SECRET_KEY",
  tags: {type: "error", project: "myproject"}

s3Stream.write("hello S3");

In the configuguration, if I omit the tags: {type: "error", project: "myproject"} an InvalidArgument: Null exception is raised.

Is this a normal behavior or an incompatibility with S3?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hey friend!

To me that sounds like the application is kicking back the configuration, but if you’re seeing more that indicates our servers returned that message, please correct me as I may be wrong. I’m taking a shot in the dark here because I’m just not big into using object storage in it’s intended ways myself, but is there a chance that when you remove that line the configuration is kicking back because of the trailing comma at the end of the secretaccesskey line?

I realize it could be a very stupid question and no help at all, but I figured it was worth a try as no one else was weighing in on it.