# log4jslogger

> A simple wrapper for log4js logger that configures itself from a file

Latest version **1.0.1** (published 2015-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install log4jslogger
pnpm add log4jslogger
yarn add log4jslogger
bun add log4jslogger
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-02-27 |
| First published | 2015-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mike Hanson |
| Maintainers | testpossessed |
| Keywords | logging, log4js |

## Links

- npm: https://www.npmjs.com/package/log4jslogger
- Repository: https://github.com/testpossessed/log4jslogger
- Issues: https://github.com/testpossessed/log4jslogger/issues
- npm.io page: https://npm.io/package/log4jslogger

## Dependencies (1)

- [log4js](https://npm.io/package/log4js.md) ^0.6.22

## 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.0.1 (latest) — 2015-02-27
- 1.0.0 — 2015-02-27

## README

# log4jslogger
A simple wrapper for log4js logger that configures itself from a file in a fixed location.

In the interest of not repeating myself over and over with the same code to provide my Node modules with basic logging capabilities I have created this module and shared it for anyone who cares to make use of it.

## Installing
log4jslogger is available via npm

```
npm install log4jslogger --save
```

Once you have it you need to create a **config** folder in the root of your application.

In this folder create a new **log4js.json** file

In this file put your log4js configuration something like this, which configures output to the console and a daily rolling date file appender.

```json
{
    "appenders": [
        { 
            "type":  "console"
        },
        {
            "type": "dateFile",
            "filename": "/logs/module.log",
            "pattern": "-dd-MM-yyyy",
            "maxLogSize": 20480
        }
    ]
}
```

Look [here](https://github.com/nomiddlename/log4js-node "log4js on GitHub") for more options

## Usage
Using log4jslogger is pretty simple

var logger = require('log4jslogger');
logger.trace('Message');
logger.debug('Message');
logger.info('Message');
logger.warn('Message');
logger.error('Message');
logger.fatal('Message');

That's it couldn't be simpler and less repetition

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