{"id":15771730,"url":"https://github.com/trstringer/azure-logger","last_synced_at":"2025-03-31T12:11:07.126Z","repository":{"id":57188727,"uuid":"48772824","full_name":"trstringer/azure-logger","owner":"trstringer","description":" :blue_book: Node.js module that makes logging to Azure extremely easy","archived":false,"fork":false,"pushed_at":"2016-02-05T02:29:41.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-12T21:13:50.931Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trstringer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-30T00:14:55.000Z","updated_at":"2023-08-24T07:28:50.000Z","dependencies_parsed_at":"2022-08-28T13:00:42.202Z","dependency_job_id":null,"html_url":"https://github.com/trstringer/azure-logger","commit_stats":null,"previous_names":["tstringer/azure-logger"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fazure-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fazure-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fazure-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fazure-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trstringer","download_url":"https://codeload.github.com/trstringer/azure-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246465228,"owners_count":20781919,"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":"2024-10-04T15:04:47.132Z","updated_at":"2025-03-31T12:11:07.110Z","avatar_url":"https://github.com/trstringer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Logger\r\n\r\nNode.js is a first-class citizen in Azure.  Logging is a necessary and important requirement of any application, and this module makes it extremely easy to quickly log entries (and subsequently read them) into an Azure storage table for later consumption/troubleshooting/etc.\r\n\r\n**TL;DR** *an easy way to log messages/entries/errors in Azure*\r\n\r\n## Installation\r\n\r\n```\r\nnpm install azure-logger\r\n```\r\n\r\n## Usage\r\n\r\n*This module uses the [`azure-storage`](https://www.npmjs.com/package/azure-storage) module to connect to Azure storage, therefore you should set the following environment variables...*\r\n - *AZURE_STORAGE_ACCOUNT*: storage account (found in Azure portal)\r\n - *AZURE_STORAGE_ACCESS_KEY*: storage account access key (found in Azure portal)\r\n\r\n### Write entry to Azure log (using defaults)\r\n\r\n```javascript\r\nvar logger = require('azure-logger');\r\n\r\n// use the default options including the default \r\n// table name \"loggerdefault\" and an entry type \r\n// of \"information\"\r\nlogger.log(myObject, function (err, res) {\r\n    if (!err) {\r\n        // successfully inserted object, which \r\n        // is returned as the res param\r\n    }\r\n});\r\n```\r\n### Write entry to Azure log (options)\r\n\r\n```javascript\r\nvar logger = require('azure-logger');\r\n\r\n// log to a specific table and with a specified \r\n// entry type\r\nvar options = {\r\n    table: 'mytable',\r\n    entryType: 'warning'\r\n};\r\nlogger.log(myObject, options, function (err, res) {\r\n    if (!err) {\r\n        // success\r\n    }\r\n});\r\n```\r\n\r\n**options** *(optional)*\r\n- *table*: the name of the specific table to insert the entry into (default: \"loggerdefault\")\r\n- *partition*: the name of the partition to insert entry into (default: \"default\")\r\n- *entryType*: type of entry (default: \"information\")\r\n\r\n### Read entries from the Azure log (default table)\r\n\r\n```javascript\r\nvar logger = require('azure-logger');\r\n\r\nlogger.get(function (err, entries) {\r\n    if (!err) {\r\n        // success\r\n    }\r\n});\r\n```\r\n\r\n### Read entries from the Azure log (specific table)\r\n\r\n```javascript\r\nvar logger = require('azure-logger');\r\n\r\nvar options = {\r\n    table: 'mytable'\r\n};\r\nlogger.get(options, function (err, entries) {\r\n    if (!err) {\r\n        // success\r\n    }\r\n});\r\n```\r\n\r\n**entries** *array of entries in log table returned by get()*\r\n - *entry*: this is the original inserted object\r\n - *type*: the specified entry type\r\n - *Timestamp*: the date when the entry was originally inserted","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrstringer%2Fazure-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrstringer%2Fazure-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrstringer%2Fazure-logger/lists"}