# @types/graylog2

> TypeScript definitions for graylog2

Latest version **0.2.5** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/graylog2
pnpm add @types/graylog2
yarn add @types/graylog2
bun add @types/graylog2
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2023-11-07 |
| First published | 2019-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/graylog2
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graylog2
- npm.io page: https://npm.io/package/@types/graylog2

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 0.2.5 (latest) — 2023-11-07
- 0.2.2 (ts3.8) — 2021-12-16
- 0.2.1 (ts3.6) — 2021-07-08
- 0.2.0 (ts2.1) — 2019-09-24
- 0.2.4 — 2023-10-18
- 0.2.3 — 2023-09-20

## README

# Installation
> `npm install --save @types/graylog2`

# Summary
This package contains type definitions for graylog2 (https://github.com/Wizcorp/node-graylog2).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graylog2.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graylog2/index.d.ts)
````ts
/// <reference types="node" />

import { EventEmitter } from "events";

export type GraylogDeflate = "optimal" | "always" | "never";

export type GraylogLogMethod =
    | "log"
    | "emergency"
    | "alert"
    | "critical"
    | "error"
    | "warning"
    | "warn"
    | "notice"
    | "info"
    | "debug";

export interface GraylogConfig {
    /**
     * The name of a host.
     * The default value is "os.hostname()"
     */
    hostname?: string | undefined;

    /**
     * The facility - log's field type in Graylog.
     * The default value is "Node.js"
     */
    facility?: string | undefined;

    /**
     * The strategy for a message compression:
     *  "always"  -  every message will be compressed with zlib.deflate
     *  "never"   -  no compression
     *  "optimal" -  messages bigger than GraylogConfig.bufferSize will be compressed
     *
     *  The default value is "optimal"
     */
    deflate?: GraylogDeflate | undefined;

    /**
     * The max UDP packet size. Should never exceed the MTU of your system.
     * The default value is 1400
     */
    bufferSize?: number | undefined;

    /**
     * The list of graylog servers
     */
    servers: ReadonlyArray<Readonly<{ host: string; port: number }>>;
}

export class graylog extends EventEmitter {
    constructor(config: Readonly<GraylogConfig>);

    log(message: string | Error | Record<string, any>): void;
    log(message: string, fullMessage: string, additionalFields?: Record<string, any>, timestamp?: number): void;
    log(message: string | Error, additionalFields?: Record<string, any>, _?: undefined, timestamp?: number): void;
    log(
        message: string | Error | Record<string, any>,
        _: undefined,
        additionalFields: Record<string, any> | undefined,
        timestamp?: number,
    ): void;

    emergency: graylog["log"];
    alert: graylog["log"];
    critical: graylog["log"];
    error: graylog["log"];
    warning: graylog["log"];
    warn: graylog["log"];
    notice: graylog["log"];
    info: graylog["log"];
    debug: graylog["log"];

    close(callback?: (err: Error | undefined) => void): void;
}

export namespace graylog {
    const graylog: graylog;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Andrey Kun](https://github.com/scalder27).

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