Coder Social home page Coder Social logo

cloudflare workers support about winston-syslog HOT 7 OPEN

seguri avatar seguri commented on September 28, 2024
cloudflare workers support

from winston-syslog.

Comments (7)

seguri avatar seguri commented on September 28, 2024 1

Just an update: the Papertrail tutorial I've linked also mentions winston.transports.Http; this throws fewer errors, but still fails, as there's a dependency on fs:

$ wrangler publish
๐Ÿ‘€  ./node_modules/winston/dist/winston/tail-file.js
Module not found: Error: Can't resolve 'fs' in '/path/to/project/node_modules/winston/dist/winston'

from winston-syslog.

wbt avatar wbt commented on September 28, 2024

In short, be sure to run npm install before your publish line, and if you figure out more please feel free to post here and/or make a PR on the documentation. However, it looks like the issue is in the unix-dgram package, not in winston.

from winston-syslog.

seguri avatar seguri commented on September 28, 2024

The Workers runtime uses the V8 engine and also implements many of the standard APIs available in most modern browsers. I'm not sure there's a way to make winston work. Do you see a way around dgram in one of the provided APIs?

from winston-syslog.

wbt avatar wbt commented on September 28, 2024

I'm saying it looks like the problem is in the unix-dgram package rather than in Winston.

from winston-syslog.

seguri avatar seguri commented on September 28, 2024

I got that thanks, you wrote it twice. Do you know or have an idea how to make winston-syslog compatible with cloudworkers or not?

from winston-syslog.

DABH avatar DABH commented on September 28, 2024

I donโ€™t think you want to use the winston-syslog transport. If you are trying to send logs to some remote destination, you should use something like the built-in HTTP transport in Winston. The syslog transport is meant for writing things to Linux system logs, and I donโ€™t think that Cloudflare workers give you access to such logs since they are not designed as full-fledged Linux VMs. Hope that helps steer you in the right direction.

from winston-syslog.

DABH avatar DABH commented on September 28, 2024

There should be some polyfill for the fs module out there you can use. Or even better, see if you can trick Node into using the browser version of Winston (https://github.com/winstonjs/winston/blob/master/package.json#L59), which is designed to not rely on serverside modules like fs.

from winston-syslog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.