{"id":20604826,"url":"https://github.com/themost-framework/json-logger","last_synced_at":"2026-05-26T20:32:02.935Z","repository":{"id":224670018,"uuid":"763385126","full_name":"themost-framework/json-logger","owner":"themost-framework","description":"Json Logger","archived":false,"fork":false,"pushed_at":"2025-03-16T07:26:19.000Z","size":171,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T08:46:26.758Z","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/themost-framework.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-02-26T07:37:40.000Z","updated_at":"2025-03-16T07:25:39.000Z","dependencies_parsed_at":"2024-11-16T09:26:17.394Z","dependency_job_id":"ab68d28a-9641-43ea-91ff-bfff642c5f99","html_url":"https://github.com/themost-framework/json-logger","commit_stats":null,"previous_names":["themost-framework/json-logger"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/themost-framework/json-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themost-framework%2Fjson-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themost-framework%2Fjson-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themost-framework%2Fjson-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themost-framework%2Fjson-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/themost-framework","download_url":"https://codeload.github.com/themost-framework/json-logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themost-framework%2Fjson-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33538659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2024-11-16T09:24:58.816Z","updated_at":"2026-05-26T20:32:02.917Z","avatar_url":"https://github.com/themost-framework.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @themost/json-logger\n\n[![NPM](https://nodei.co/npm/@themost/json-logger.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/@themost/json-logger/)\n\n[![npm version](https://badge.fury.io/js/%40themost%2Fjson-logger.svg)](https://badge.fury.io/js/%40themost%2Fjson-logger)\n\nA simple JSON logger for Node.js applications.\n\n## Installation\n\n```bash\nnpm i @themost/json-logger\n```\n\n## Usage\n\n```javascript\nconst { JsonLogger } = require('@themost/json-logger');\nconst logger = new JsonLogger();\nlogger.info('Hello, world!');\n```\n\nUse `JsonLogger` class to create a new instance of JSON logger. \n\n```javascript\nconst { JsonLogger } = require('@themost/json-logger');\nconst logger = new JsonLogger({\n    level: 'info',\n    dateFormat: 'DD/MMM/YYYY:HH:mm:ss Z',\n    format: 'json',\n    stdout: process.stdout,\n    stderr: process.stderr\n});\n```\n\nThe `JsonLogger` class accepts an options object with the following properties:\n\n- `level`: The minimum log level to log. The default value is `info`. Available log levels are `info`, `warn`, `error`, `debug` and `verbose`.\n- `format`: The log format. The default value is `json`. Available log formats are `json` and `raw`.\n- `stdout`: The standard output stream. The default value is `process.stdout`.\n- `stderr`: The standard error stream. The default value is `process.stderr`.\n- `dateFormat`: The date format to use. The default value is `DD/MMM/YYYY:HH:mm:ss Z`. The date format is based on the [date-and-time](https://github.com/knowledgecode/date-and-time) library.\n\nIf the `format` property is set to `json`, the log message will be formatted as a JSON object. Otherwise, the log message will be formatted as a raw string.\nIf you try to instantiate a `JsonLogger` without log level, the default log level will be `info` or `debug` based on the `NODE_ENV` environment variable\nwhen it is set to `test` or `development` respectively.\n\n## Methods\n\nThe `JsonLogger` provides the following methods:\n\n- `info(message: string, ...args: any[])`: Logs an informational message.\n- `warn(message: string, ...args: any[])`: Logs a warning message.\n- `error(message: string, ...args: any[])`: Logs an error message.\n- `debug(message: string, ...args: any[])`: Logs a debug message.\n- `verbose(message: string, ...args: any[])`: Logs a verbose message.\n- `log(message: string, ...args: any[])`: A shorthand for `info` method.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemost-framework%2Fjson-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemost-framework%2Fjson-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemost-framework%2Fjson-logger/lists"}