Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How do I write logs to filesystem from NodeJS?

I have been trying to use Winston or Bunyan loggers with a NodeJS proxy. However I am unable to write out a log file and can only write to console which eventually get amalgamated within the MP logs.

I'd like to keep the Node logs separate so that it is easier to read / trace at a later point.

We are using the OPDK version and we have been trying all possible file system permissions but are unable to write any file out of Edge to the filesystem.

I can across this in the docs -> "Filesystem access is restricted to the directory where the script was launched: the /resources/nodedirectory. Node.js scripts may read and write files within this directory, for instance as a temporary scratch area, but there are no guarantees as to how long the files will persist."

Link : http://apigee.com/docs/api-services/content/understanding-edge-support-nodejs-modules

Does this mean that *absolutely* nothing can be done to be able to write files to the file system on the MP / MS?

1 2 1,167
2 REPLIES 2