# Serilog EcsTextFormatter: Not what I expected

**URL:** https://discuss.elastic.co/t/serilog-ecstextformatter-not-what-i-expected/263781
**Category:** Logs
**Tags:** dotnet
**Created:** [February 9, 2021, 5:07pm UTC](https://discuss.elastic.co/t/serilog-ecstextformatter-not-what-i-expected/263781 "2021-02-09T17:07:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sgtobin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sgtobin/32/83662_2.png) [@sgtobin](https://discuss.elastic.co/u/sgtobin)
#### Post date: [February 9, 2021, 5:07pm UTC](https://discuss.elastic.co/t/serilog-ecstextformatter-not-what-i-expected/263781/1 "2021-02-09T17:07:24Z")

</div>

This c# code...

```auto
class Program
{
    static void Main(string[] args)
    {
        Log.Logger = new LoggerConfiguration()
            .MinimumLevel.Debug()
            .WriteTo.Console(new EcsTextFormatter())
            .CreateLogger();
        var user = new Elastic.CommonSchema.User
        {
            Id = "111",
            Name = "test"
        };
        Log.Information("{@user}", user);
    }
}

```

...puts the 'user' object under '\_metadata'. I would have though that because I used an Elastic.CommonSchema.User object, it would have come out at the top level. What am I missing?

---

<div class="post-metadata">

### Author: ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)
#### Post date: [February 15, 2021, 10:42am UTC](https://discuss.elastic.co/t/serilog-ecstextformatter-not-what-i-expected/263781/2 "2021-02-15T10:42:52Z")

</div>

Heya @sgtobin. To help out anyone else with a similar question in future, I thought I'd link to our discussion about this on the GitHub issue:

> <https://github.com/elastic/ecs-dotnet/issues/133>
>
> This c# code...
> class Program
> {
> static void Main(string\[\] args)
> {
> Log.Logger = new LoggerConfiguration()
> .MinimumLevel.Debug()
> .WriteTo.Console(new EcsTextFormatter())
> .CreateLogger();
> var user = new...

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 15, 2021, 10:42am UTC](https://discuss.elastic.co/t/serilog-ecstextformatter-not-what-i-expected/263781/3 "2021-03-15T10:42:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
