# mailog

> log event to mail and web

Latest version **2.0.3** (published 2024-02-20) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2024-02-20 |
| First published | 2023-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 29.5 KB |
| Known vulnerabilities | 0 (+22 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | JuanLee |
| Maintainers | ninejuan |
| Keywords | logger, mail, log |

## Links

- npm: https://www.npmjs.com/package/mailog
- Repository: https://github.com/ninejuan/mailog
- Homepage: https://github.com/ninejuan/mailog#readme
- Issues: https://github.com/ninejuan/mailog/issues
- npm.io page: https://npm.io/package/mailog

## Dependencies (11)

- [ejs](https://npm.io/package/ejs.md) ^3.1.9
- [xss](https://npm.io/package/xss.md) ^1.0.14
- [path](https://npm.io/package/path.md) ^0.12.7
- [bcrypt](https://npm.io/package/bcrypt.md) ^5.1.0
- [crypto](https://npm.io/package/crypto.md) ^1.0.1
- [express](https://npm.io/package/express.md) ^4.18.2
- [passport](https://npm.io/package/passport.md) ^0.6.0
- [nodemailer](https://npm.io/package/nodemailer.md) ^6.9.3
- [passport-local](https://npm.io/package/passport-local.md) ^1.0.0
- [express-session](https://npm.io/package/express-session.md) ^1.17.3
- [moment-timezone](https://npm.io/package/moment-timezone.md) ^0.5.43

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2024-02-20
- 2.0.2 — 2023-07-20
- 2.0.1 — 2023-07-20
- 2.0.0 — 2023-07-20
- 1.0.2-alpha — 2023-07-15
- 1.0.1-alpha — 2023-07-15
- 1.0.0 — 2023-06-30

## README

# Mailog

[`Mailog`](https://mailog.juany.kr) is useful Logging module.

This module lets you log events simply and can get logs by E-Mail and Website.
By using Mailog into your project, You won't be worry about event log of your services.

## Install

    $ npm install mailog

## Usage

#### Initalize Module

You need to initalize module before logging.
Init Function requires `log` and `web` Objects.
First, You should write information related to your mail account in the log section.
Second, You should write authenication data into the web section.

Your input will be encrypted via `bcrypt` and `base64`.

Example:

    const mailog = require('mailog');
    // import * as mailog from 'mailog';
    mailog.init({ // Log Part
        host: "smtp.hanmail.net",
        port: 465,
        svcName: "Your Service Name",
        useSecureConnection: true,
        auth: {
            id: "your id",
            pass: "your password"
        },
        sender: "your email",
        receiver: "your email",
        timeZone: "Asia/Seoul"
    }, { // Web Part
        use: true, // or false
        port: 5002, // if you want to use web part, set use to true and set port
        auth: {
            id: 'admin',
            pass: 'admin'
        }
    })

#### Log Event

Use `mailog.info` to log information level.
Mailog have 4 Log Level, `info`, `warn`, `error`, `debug`.

Example:

    const mailog = require('mailog');
    // import * as mailog from 'mailog';
    
    mailog.info("Hello World!", false); //false means don't mail this log.
    mailog.warn("Watch Out!", true);
    mailog.error("There is an error...", false);
    mailog.debug("Bezzzz. I'm bug!", true);

#### Check Logs on Web
Log web's default port is 5001.
you can acccess web logs at `http://your.domain:5001`

## Examples

If you need example file, you can get [examples](https://github.com/ninejuan/mailog/tree/production/example) here.

## Credits

  - [Juan Lee](https://juany.kr)

## License

[GNU GPL 3.0 License](https://www.gnu.org/licenses/gpl-3.0.html)

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