How to use the beaver-logger.Logger function in beaver-logger

To help you get started, we’ve selected a few beaver-logger examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github magma / magma / nms / app / fbcnms-packages / fbcnms-ui / utils / Logging.js View on Github external
export const ServerLog = (topic: string) =>
  beaver.Logger({
    url: '/logger/' + topic,
    logLevel: beaver.LOG_LEVEL.INFO,
    flushInterval: 10 * 1000,
    // eslint-disable-next-line flowtype/no-weak-types
    transport: async ({url, method, json}): Promise =>
      axios({
        method,
        url,
        data: json.events.map(e => {
          const {event, level, payload} = e;
          const {timestamp, data, user} = payload;
          return {
            event,
            level,
            ts: timestamp / 1000,
            data,