Developer guide

ArgusLogs logging & data annotations

Use Data Annotations (Attributes) and the ArgusLogs static logger to record method executions and capture manual application telemetries.

Tutorials are hands-on walkthroughs (prerequisites, install, configuration, code, expected result, explanation, then next steps). Official reference stays in documentation — this is not a full docs clone.

Section 3 of 4 ArgusLogs.DataAnnotation

How they work together

When a method marked with [LogMethod] runs and calls ArgusLogs, the manual logs are grouped under the same context trace, producing structured logs:

OrderService.cs
public class OrderService
{
    [LogMethod]
    public void SubmitOrder(Order order)
    {
        // 1. [LogMethod] logs: ENTER - SubmitOrder (Parameters: order)

        ArgusLogs.Info("Validating order inventory"); // 2. Logs within the active TraceId

        if (order.Amount > 10000)
        {
            ArgusLogs.Warning("High-value order flagged"); // 3. Same TraceId
        }

        // 4. [LogMethod] logs: EXIT - SubmitOrder (Duration: 42ms)
    }
}