You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
I have class like this:
public class Payment
{
public int PaymentId { get; set; }
public Guid UserId { get; set; }
public DateTime OccuredAt { get; set; }
[LogMasked]
public string Email { get; set; }
}
var payment = new Payment
{
PaymentId = 1,
UserId = Guid.NewGuid(),
Email = "[email protected]",
OccuredAt = DateTime.UtcNow
};
logger.Information("Received payment with details {@payment}", payment);
logger.Information("Received payment with details Payment Id: {PaymentId}, Email: {Email}", payment.PaymentId, payment.Email);
When using Destructurama.Attributed, the [LogMasked] attribute works only when logging the entire object as a structured property, like {@payment}. Unfortunately, if we log properties individually ({Email}), Serilog doesn’t apply the attribute-based masking by default.
Describe the solution you'd like
This is optional description of what you want to happen.
Create a custom attribute to indicate that field is masked as well, ensuring that sensitive fields are consistently masked regardless of how they’re logged.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
I have class like this:
public class Payment
{
public int PaymentId { get; set; }
}
var payment = new Payment
{
PaymentId = 1,
UserId = Guid.NewGuid(),
Email = "[email protected]",
OccuredAt = DateTime.UtcNow
};
logger.Information("Received payment with details {@payment}", payment);
logger.Information("Received payment with details Payment Id: {PaymentId}, Email: {Email}", payment.PaymentId, payment.Email);
When using Destructurama.Attributed, the [LogMasked] attribute works only when logging the entire object as a structured property, like {@payment}. Unfortunately, if we log properties individually ({Email}), Serilog doesn’t apply the attribute-based masking by default.
Describe the solution you'd like
This is optional description of what you want to happen.
Create a custom attribute to indicate that field is masked as well, ensuring that sensitive fields are consistently masked regardless of how they’re logged.
The text was updated successfully, but these errors were encountered: