---
title: Instantiating a Loggy instance
description: The CreateLoggy function
---

This instantiates a loggy logger and accepts a LoggyConfig interface. Once created you can call loggy in various formats to log messages of different levels.

```javascript
  const loggy = CreateLoggy({
    level: "info", // debug, info, warn, or error
    identifier: "my-app", // an identifier for your application or service
    color: true, // enable colors
    compact: false, // compact mode for json objects
    timestamp: true // show the timestamp in the log message
  });

  loggy.log("This is a log message");
  loggy.info("This is an info message");
  loggy.warn("This is a warn message");
  loggy.error("This is an error message");
```

## Further reading

- See more about the [Loggy configuration options](/reference/loggy-config)
