---
title: Logging with Loggy
description: Logs, info, errors, tags, etc...
---

Loggy accepts a `tags` parameter after the log message you want to print that can include an object. This can be helpful when printing error messages and you need more information for debugging.

```javascript
  const user = {
    user: {
      id: 123,
      name: 'John Doe',
      details: {
        age: 30,
        address: {
          city: 'New York',
          zip: '10001'
        }
      }
    }
  }

  const loggy = CreateLoggy({
    level: "error",
    identifier: "my-app",
  });

  loggy.log("This is a log message");
  loggy.error("This is an error message with tags", user);
```

Will print the following to the console

```bash
7/14/2025 10:29:11 PM [LOG] my-app: This is a log message
7/14/2025 10:29:14 PM [ERROR] my-app: This message contains nested objects in the tags.
{
  user: {
    id: 123,
    name: 'John Doe',
    details: {
      age: 30,
      address: {
        city: 'New York',
        zip: '10001'
      }
    }
  }
}
```

## Further reading

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