# Creating a Custom Layout

You can easily create a custom layout object by creating a component that extends `logbox.system.logging.Layout` and implementing a `format()` method. Below you can see the method signature:

{% tabs %}
{% tab title="BoxLang" %}

```java
class extends="logbox.system.logging.Layout" {

    string function format( required logbox.system.logging.LogEvent logEvent ){
        // inspect logEvent and return your formatted string
        return "[#logEvent.getSeverity()#] #logEvent.getCategory()# - #logEvent.getMessage()#"
    }

}
```

{% endtab %}

{% tab title="CFML" %}

```cfscript
component extends="logbox.system.logging.Layout" {

    string function format( required logbox.system.logging.LogEvent logEvent ){
        // inspect logEvent and return your formatted string
        return "[#logEvent.getSeverity()#] #logEvent.getCategory()# - #logEvent.getMessage()#";
    }

}
```

{% endtab %}
{% endtabs %}

All you need to do is inspect the logging event, build your message string, and return it. That's it!

To configure LogBox to use your custom layout object, set the `layout` key in your LogBox configuration with the dotted component path to your custom layout object. See [Appenders in the Configuration section](https://logbox.ortusbooks.com/configuration/configuring-logbox/logbox-dsl#appenders)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://logbox.ortusbooks.com/extending-logbox/creating-a-custom-layout.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
