No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Best practices for logging?

    Help
    4
    4
    707
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mboeni
      mboeni last edited by

      Hi there

      I just wondered how to go about logging in Quasar and/or Vue. I have found very little documentation so far.

      Is there a tested/proven approach to setting up logging to be used in development as well as production?

      Cheers,
      M.

      qyloxe 1 Reply Last reply Reply Quote 1
      • Q
        QuaSam last edited by QuaSam

        I would like to second this question, and see if the popular logger Winston would be recommended with Quasar (SPA mainly), or something else. Update 11/15/20: Winston looks like a good solution for Electron: just npm install winston and code below works:
        // winston logger 11/15/20
        import { createLogger, format, transports } from ‘winston’
        const logger = createLogger({
        level: ‘info’,
        defaultMeta: { service: ‘user-service’ },
        format: format.combine(
        format.timestamp({
        format: ‘YYYY-MM-DD HH🇲🇲ss’
        }),
        // format.errors({ stack: true}),
        format.splat(),
        format.json()
        ),
        transports: [
        new transports.File({ filename: ‘C:/temp/templog.log’, level: ‘info’})
        ]
        })
        logger.log(‘info’, ‘Hello, World of Winston Logging!’)
        logger.info(‘Hello, again, World of Winston Logging!’)

        output line: {“message”:“Hello, again, World of Winston Logging!”,“level”:“info”,“service”:“user-service”,“timestamp”:“2020-11-15 20:25:57”}

        1 Reply Last reply Reply Quote 0
        • qyloxe
          qyloxe @mboeni last edited by

          @mboeni nice question. My ideal logger:

          • would be implemented as web worker (it will not be a burden for main browser thread)
          • should write data to local indexeddb and then sync (when online) with logging backend service (because even if not online you should have a possibility to log events and review them later)
          • should have a possibility to implement plugins for example mouse position heat maps, touch gestures, eye movement, browser capabilities etc.
          • the sync protocol should be open so there will be at least one open source backend server in nodejs or python-fastapi and at least one commercial backend with extended analytics etc.
          • should have tons of examples, snippets and demos
          • should have quasar app extension for… something (?) ok - quasar integration out of the box would be really, really nice
          1 Reply Last reply Reply Quote 0
          • D
            drewhillashima last edited by

            Also very interested in a good logging solution which implements as a web worker

            1 Reply Last reply Reply Quote 1
            • First post
              Last post