# logm

> file logger by Max

Latest version **0.2.5** (published 2014-08-21) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2014-08-21 |
| First published | 2014-08-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+13 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Max |
| Maintainers | maxlee1994 |
| Keywords | logger |

## Links

- npm: https://www.npmjs.com/package/logm
- Repository: https://github.com/MaxLee1994/logM
- Issues: https://github.com/MaxLee1994/logM/issues
- npm.io page: https://npm.io/package/logm

## Dependencies (3)

- [colors](https://npm.io/package/colors.md) 0.6.2
- [moment](https://npm.io/package/moment.md) 2.8.1
- [nodemailer](https://npm.io/package/nodemailer.md) 1.2.0

## 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

- 0.2.5 (latest) — 2014-08-21
- 0.2.4 — 2014-08-21
- 0.2.3 — 2014-08-21
- 0.2.2 — 2014-08-21

## README

# File Logger for `Node.js` @version 0.2.5

## installation
    npm install logm
    
## usage
    var logM = require('logm');
    logM.configure('logM-config.json');
    var logger = logM.getLogger('logger');
    
    logger.log('this is a log');
    logger.debug('this is a debug');
    logger.warn('this is a warn');
    logger.error('this is a error');
    logger.trace('this is a trace');
    
## config
loggers must be defined in config file, and pass the config file to `configure` method.   
`configure` must be called before `getLogger`

**config file sample**

    {  
        "logger1": {  
            "exclude": [  
              "DEBUG"  
            ],  
            logDir": "log/",
            "filePrefix": "test"
        },
        "logger2": {
            "exclude": [
                "LOG", "WARN"
            ],
            "logDir": "log/",
            "filePrefix": "test"
        },
        "logger3": {
            "logDir": "log/",
            "filePrefix": "tesss"
        },
        "logger4": {
            "logDir": "logg/",
            "filePrefix": "test"
        }
    }
   
## notify maintainer by mail
**usage**
	
	var logger = logM.getLogger('logger');
	logger.notifyMaintainer('maintainer@website.com',
						    'subject',
						    'content');
				
**annotation**	

1. mail host is set to author Max <max@vzhibo.tv>
2. no matter how many mails with same subject in 30 min will only be sent once.
3. if u want to send a specific mail ignore annotation 2, append a `true` param calling the `notifyMaintainer` method, which means no queue for this mail.

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