You can log class objects without explicit serialization using structured logging in Serilog. Serilog can automatically serialize your objects during logging. Here is an example:

public class MyClass
{
    public int Id { get; set; }
    public string Name { get; set; }
}

public class MyService
{
    private readonly ILogger<MyService> _logger;

    public MyService(ILogger<MyService> logger)
    {
        _logger = logger;
    }

    public void SomeMethod()
    {
        var myObject = new MyClass
        {
            Id = 1,
            Name = "Test"
        };

        _logger.LogInformation("Logging an object: {@MyObject}", myObject);
    }
}

In this example, MyClass is logged with LogInformation. The @ symbol in front of MyObject in the log message tells Serilog to serialize myObject and include it in the log event. When this log event is written, myObject will be automatically serialized to a string representation.