{"id":23819882,"url":"https://github.com/kth/kth-node-log","last_synced_at":"2025-06-15T20:42:24.769Z","repository":{"id":57125744,"uuid":"67046469","full_name":"KTH/kth-node-log","owner":"KTH","description":"Logging module for Node.js applications.","archived":false,"fork":false,"pushed_at":"2025-04-01T04:49:01.000Z","size":578,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-05-22T07:48:45.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KTH.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-31T14:46:37.000Z","updated_at":"2025-02-12T13:00:32.000Z","dependencies_parsed_at":"2023-11-15T10:51:08.200Z","dependency_job_id":null,"html_url":"https://github.com/KTH/kth-node-log","commit_stats":{"total_commits":59,"total_committers":12,"mean_commits":4.916666666666667,"dds":0.6610169491525424,"last_synced_commit":"a9f24f4a2fc36f800297eb3ca73d97b3083768c2"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/KTH/kth-node-log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KTH","download_url":"https://codeload.github.com/KTH/kth-node-log/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-log/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260046714,"owners_count":22950897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-02T07:16:15.174Z","updated_at":"2025-06-15T20:42:24.743Z","avatar_url":"https://github.com/KTH.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @kth/log\n\nLogging module for Node.js applications.\n\n## Usage\n\nThe package will respect NODE_ENV and output serialized JSON in production\nand use ordinary output for development.\n\nThe package uses bunyan.stdSerializers.err for err and provides serializers for req and res objects. Only subset of fields are displayed by these serializers.\n\n### In your application\n\n```javascript\nconst log = require('@kth/log')\n\n// in application setup, see full options below\nlog.init({\n  name: 'node-app',\n  level: 'warn',\n})\n\n// log usage\nlog.info('hello from info, log level usually used in setup')\nlog.warn('error that code handled and can recover from')\nlog.error({ err: err }, 'error that should be fixed in code')\nlog.fatal('a really bad error that will crash the application')\nlog.debug({ req: req, res: res }, 'log a request and response, basic dev log')\nlog.trace('granular logging, rarely used')\n\n// child logger\n// add custom values to all of the logs\nconst myLog = log.child({ custom: 'value' })\nmyLog.info('hello')\n```\n\n## Options\n\n```javascript\nlog.init({\n  // name of the logger, usually the same as application name, default is 'node-log'\n  name: 'node-app',\n\n  // If developement or test, the output is sent to stdout (console) using Bunyan-format 'short', default value is retrieved from process.env.NODE_ENV\n  env: 'development',\n\n  // default logging level is INFO\n  level: 'debug',\n\n  // Provide a custom serializer if necessary, default serializer for err, req and res are included in the package.\n  serializers: {\n    err: customSerializer,\n  },\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fkth-node-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkth%2Fkth-node-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fkth-node-log/lists"}