# azure-function-log-intercept

> Add console.log support to Azure Functions

Latest version **1.1.11** (published 2026-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install azure-function-log-intercept
pnpm add azure-function-log-intercept
yarn add azure-function-log-intercept
bun add azure-function-log-intercept
```

## Health

**Score 53/100 (C)** — status: active.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.11 |
| Published | 2026-06-08 |
| First published | 2020-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/azure-function-log-intercept) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Brian Rosamilia |
| Maintainers | ros |
| Keywords | azure functions, log, console, appinsights, application insights |

## Links

- npm: https://www.npmjs.com/package/azure-function-log-intercept
- Repository: https://github.com/BrianRosamilia/azure-function-log-intercept
- Issues: https://github.com/BrianRosamilia/azure-function-log-intercept/issues
- npm.io page: https://npm.io/package/azure-function-log-intercept

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.1.11 (latest) — 2026-06-08
- 1.1.10 — 2026-04-07
- 1.1.9 — 2026-01-23
- 1.1.8 — 2025-09-22
- 1.1.7 — 2025-05-27
- 1.1.6 — 2025-01-22
- 1.1.5 — 2024-11-10
- 1.1.4 — 2024-02-19
- 1.1.3 — 2023-08-08
- 1.1.2 — 2023-01-01
- 1.1.1 — 2022-09-30
- 1.1.0 — 2022-03-02
- 1.0.11 — 2021-10-20
- 1.0.10 — 2021-09-21
- 1.0.9 — 2021-04-29
- … 9 more at https://npm.io/package/azure-function-log-intercept/versions

## README

# azure-function-log-intercept

[![Build Status](https://ros.visualstudio.com/Brian/_apis/build/status/BrianRosamilia.azure-function-log-intercept?branchName=master)](https://ros.visualstudio.com/Brian/_build/latest?definitionId=2&branchName=master)

`console.log` doesn't actually log as you would expect in node.js Azure Functions.  You are expected to use `context.log` and context is _not_ a global object, it's a parameter to your Azure Function so you would have to pass this throughout your modules/functions to get logging like you would expect.  

This package fixes this with minimal friction, 0 dependencies, and allows you to use `console.log` (and other `console` methods) like normal.

More information here: https://github.com/Azure/Azure-Functions/issues/1396 

Supports:

* `console.log`
* `console.error`
* `console.warn`
* `console.info`

[`npm install azure-function-log-intercept`](https://www.npmjs.com/package/azure-function-log-intercept)

```
const intercept = require('azure-function-log-intercept');
const storage = require('./StorageService.js');

module.exports = async function (context, myQueueItem) {
    intercept(context);// console.log works now!
    
    await storage.storeMessage(myQueueItem);

    console.log('Function Completed');
};
```

---
_Source: https://npm.io/package/azure-function-log-intercept · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
