Socket
Book a DemoInstallSign in
Socket

@koa/access-log

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koa/access-log

Middleware for common log format access logs

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
10
-56.52%
Maintainers
0
Weekly downloads
 
Created
Source

Accesslog

Output Common Log Format access logs to any stream. Defaults to process.stdout.

Notice: We recommend using @koa/access-log for installation, as both koa-accesslog and @koa/access-log refer to the same module. However, in our next major version bump (v2), we will deprecate koa-accesslog and only maintain @koa/access-log.

Install

# npm ..
npm i koa-accesslog
# yarn ..
yarn add koa-accesslog

or

# npm ..
npm i @koa/access-log
# yarn ..
yarn add @koa/access-log

Usage

const Koa = require('koa');
const accesslog = require('koa-accesslog');
// or
// const accesslog = require('@koa/access-log');
const app = new Koa();

app.use(accesslog());

Output

127.0.0.1 - - [19/Nov/2014:13:47:37 +0100] "GET / HTTP/1.X" 404 -

Configure

You may configure Accesslog to use any writable stream such as an instance of stream.PassThrough as seen below.

const log = new stream.PassThrough();
app.use(accesslog(log));

License

MIT

Keywords

common

FAQs

Package last updated on 12 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts