Giter Site home page Giter Site logo

nuxt-winston-log's People

Contributors

aaronransley avatar tyriis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nuxt-winston-log's Issues

How to separate info and error to different files?

I tried to configure like this

winstonLog: {
    transportOptions: {
        format: combine(
          timestamp(),
          prettyPrint()
        ),
      },
    transports: [
      new transports.File({
        level: 'info',
        filename: 'access.log',
      }),
      new transports.File({
        level: 'error',
        filename: 'error.log',
      })
    ]
  },

But it doesn't work. I want to scope error logs in error.log file and info logs in access.log file.

Example of middleware usage?

Do you have any middleware/servermiddleware example?
Getting "cannot set headers" and/or page not loading. So I guess im missing something :(

edit: I have it working and showing in grafana, just one issue with servermiddleware/middleware.

How to use $winstonLog on asyncData method ?

Hello,

I would like use $winstonLog on asyncData method.
But Property '$winstonLog' does not exist on type 'Context' ...

Do you have an idea for use it ?

async asyncData(ctx: Context) {
  ctx.$winstonLog.info('Hello');
}

Thank you

Upgrade module with Nuxt 3 compatibility

hi,

I have nuxt-winston-log setup in my Nuxt 2 app to output to the console transport, as such:

winstonLog: {
    useDefaultLogger: false,
    loggerOptions: {
      format: combine(timestamp(), errors({ stack: true }), json()),
      transports: [new transports.Console()],
    },
},

Works great in Nuxt 2, but for some reason, nothing happens in a Nuxt 3 app :|

Any idea why ?

Do not write to the filesystem if not needed

Hello! When I use the logger with the console transport I don't want to write the filesystem in any way. This can be an issue for read only filesystems. This line

mkdirIfNotExists(resolve(process.cwd(), winstonOptions.logPath))
creates the logs diretory anyway and there is no way to override this behaviour.

Is it possible to log client-side requests?

In our application, some of the HTTP calls done are server-side (asyncData / page level) but others client-side (mounted hook, created hook, fetch hook). How would the latter be logged with winston? Is it possible?

"info" level brings throw messages

I have an issue with access logs.

In readme: "info level: Basic access logs for all endpoints in your Nuxt app"

But, if i set transport config:

new transports.File({
                    format: combine(
                        timestamp(),
                        prettyPrint()
                    ),
                    level: 'info',
                    logPath: '/var/log/frontier/',
                    filename: '/var/log/frontier/access.log',
})

And after in some vue file, for eg index.vue get any simple throw:

mounted() {
        throw "Warning test";
 }

In my access.log file I have access logs and throw message in strange format:

'0': 'W',                                                                                                                                                                                                                                   

  '1': 'a',                                                                                                                                                                                                                                   

  '2': 'r',                                                                                                                                                                                                                                   

  '3': 'n',                                                                                                                                                                                                                                   

  '4': 'i',                                                                                                                                                                                                                                   

  '5': 'n',                                                                                                                                                                                                                                   

  '6': 'g',                                                                                                                                                                                                                                   

  '7': ' ',                                                                                                                                                                                                                                   

  '8': 't',                                                                                                                                                                                                                                   

  '9': 'e',                                                                                                                                                                                                                                   

  '10': 's',                                                                                                                                                                                                                                  

  '11': 't',

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.