# aurelia-logging-file

> File appender for `aurelia-logging`

Latest version **1.0.2** (published 2019-05-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install aurelia-logging-file
pnpm add aurelia-logging-file
yarn add aurelia-logging-file
bun add aurelia-logging-file
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-05-13 |
| First published | 2019-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 21 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Homa Wong |
| Maintainers | unional |

## Links

- npm: https://www.npmjs.com/package/aurelia-logging-file
- Repository: https://github.com/unional/logging
- Issues: https://github.com/unional/logging/issues
- npm.io page: https://npm.io/package/aurelia-logging-file

## Dependencies (4)

- [unpartial](https://npm.io/package/unpartial.md) ^0.6.2
- [upper-case](https://npm.io/package/upper-case.md) ^1.1.3
- [global-store](https://npm.io/package/global-store.md) ^0.8.1
- [aurelia-logging](https://npm.io/package/aurelia-logging.md) ^1.5.2

## Recent versions

- 1.0.2 (latest) — 2019-05-13
- 1.0.1 — 2019-04-23
- 1.0.0 — 2019-02-09

## README

# aurelia-logging-file

[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]

File based appenders for `aurelia-logging` and `@unional/logging`.

## Usage

```ts
import { addAppender } from 'aurelia-logging' // or `@unional/logging`
import { FileAppender } from 'aurelia-logging-file'

// All logs are appended to the same file.
const file = new FileAppender('filename.log')
addAppender(file)

// log away...
```

You can change the format of your messages:

```ts
import { stringifyLogLevel } from 'aurelia-logging-file'

new FileAppender('filename.log', { format: '{id}({LEVEL}): {messages}}' })
new FileAppender('filename.log', {
  format: (id, level, messages) => `${id}(${stringifyLogLevel(level)}): ${messages}`
})
```

- `{ID}` will print logger id in upper case.
- `{LEVEL}` will print log level in upper case.

[npm-image]: https://img.shields.io/npm/v/aurelia-logging-file.svg?style=flat
[npm-url]: https://npmjs.org/package/aurelia-logging-file
[downloads-image]: https://img.shields.io/npm/dm/aurelia-logging-file.svg?style=flat
[downloads-url]: https://npmjs.org/package/aurelia-logging-file
[travis-image]: https://img.shields.io/travis/unional/logging/master.svg?style=flat
[travis-url]: https://travis-ci.org/unional/logging?branch=master
[coveralls-image]: https://coveralls.io/repos/github/unional/logging/badge.svg
[coveralls-url]: https://coveralls.io/github/unional/logging

---
_Source: https://npm.io/package/aurelia-logging-file · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
