---
title: Configuration
description: Loggy configuration
---

Loggy currently accepts a few different configuration options.

```typescript
interface LoggyConfig {
  level: string;
  identifier: string;
  color?: boolean;
  compact?: boolean;
  timestamp?: boolean;
}
```

## Level

The `level` allows your to define what level to expose logs. This is useful for larger production level environments where you may not want to see everything. You can control your log level with env vars like so

```javascript
  const loggy = CreateLoggy({
    level: `${env.ENVIRONMENT === "dev" ? 'info' : 'error'}` // show info and log messages in dev environments, error and log messages in non-dev environments
    identifier: "my-app",
  });
```

## Identifier

The `identifier` allows you to prefix messages with a custom string. Useful for if you have multiple services running in the same instance. You can instantiate multiple Loggy instances and prefix them accordingly, for example:

```javascript
  const serviceLoggy = CreateLoggy({
    level: "error",
    identifier: "myService",
  });

  const dbLoggy = CreateLoggy({
    level: "warn",
    identifier: "myDb",
  });
```

Will print logs like

```bash
7/14/2025 9:16:28 PM [LOG] myService: This message is from your app service
7/14/2025 9:17:14 PM [LOG] myDb: This message is from your db service
```

## Color

The `color` allows you to toggle the pretty colors on and off. Defaults to `true`.

## Compact

The `compact` flag will collapse json objects. Defaults to `false`.

## Timestamp

The `timestamp` flag allows you to toggle showing the timestamp in logs. Defaults to `true`.

## Further reading

- See more about what's [on the roadmap](/roadmap/)
