<commit_before># log4js2
log4js2 is a fast and lightweight logging library that enables logging flexibility within JavaScript/TypeScript applications, 
similar to Apache's [Log4j2 library](https://logging.apache.org/log4j/2.x/). It can also serve as a drop-in replacement for log4js, 
since the namespace and functions are mostly similar.

[![Build Status](https://travis-ci.org/anigenero/log4js2.svg?branch=master)](https://travis-ci.org/anigenero/log4js2)
[![codecov](https://codecov.io/gh/anigenero/log4js2/branch/master/graph/badge.svg)](https://codecov.io/gh/anigenero/log4js2)

- [Read the Docs](https://anigenero.github.io/log4js2/)

## Installing & Building

If you're building from source, simply run

```bash
> npm install
> npm run build
```

Or, you can install log4js2 from npm.

```bash
> npm install --save log4js2
```

## Getting Started

Logging works out-of-the-box, with no configuration. However, note that only error messages will display without 
specific configuration.

```javascript
import {getLogger} from 'log4js2';

const logger = getLogger('myLogger');

console.error('Console error'); // this will show

logger.error('This is an error log'); // this will show
logger.debug('This is a debug log'); // this will not show
```

#### Configuration

Configure log4js using the `configure()` method. _This must be the first thing you do_. Otherwise, 
the first log you commit will not allow updates from this function

```typescript
import {configure, LogLevel} from 'log4js2';

configure({
    layout : '%d [%p] %c %M:%line:%column - %m %ex',
    appenders : ['Console'],
    loggers : [{<commit_msg>docs fix<commit_after># log4js2
log4js2 is a fast and lightweight logging library that enables logging flexibility within JavaScript/TypeScript applications, 
similar to Apache's [Log4j2 library](https://logging.apache.org/log4j/2.x/). It can also serve as a drop-in replacement for log4js, 
since the namespace and functions are mostly similar.

[![Build Status](https://travis-ci.org/anigenero/log4js2.svg?branch=master)](https://travis-ci.org/anigenero/log4js2)
[![codecov](https://codecov.io/gh/anigenero/log4js2/branch/master/graph/badge.svg)](https://codecov.io/gh/anigenero/log4js2)

- [Read the Docs](https://anigenero.github.io/log4js2/)

## Installing & Building

If you're building from source, simply run

```bash
> npm install
> npm run build
```

Or, you can install log4js2 from npm.

```bash
> npm install --save @log4js2/core
```

## Getting Started

Logging works out-of-the-box, with no configuration. However, note that only error messages will display without 
specific configuration.

```javascript
import {getLogger} from 'log4js2';

const logger = getLogger('myLogger');

console.error('Console error'); // this will show

logger.error('This is an error log'); // this will show
logger.debug('This is a debug log'); // this will not show
```

#### Configuration

Configure log4js using the `configure()` method. _This must be the first thing you do_. Otherwise, 
the first log you commit will not allow updates from this function

```typescript
import {configure, LogLevel} from 'log4js2';

configure({
    layout : '%d [%p] %c %M:%line:%column - %m %ex',
    appenders : ['Console'],
    loggers : [{
{'fraction_non_alphanumeric': 0.13111726685133887, 'fraction_numerical': 0.017236072637734686, 'mean_word_length': 4.613126079447323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '842632', 'n_tokens_mistral': 1055, 'n_tokens_neox': 1008, 'n_words': 335}