Configures ABP logging: typed ILogger injection, IInitLoggerFactory for startup buffering, ABP exception logging via LogException, and Serilog bridge.
Ships in abp-infrastructure. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
ILogger<T>.ABP does not replace Microsoft.Extensions.Logging. Register providers through the standard .NET host and inject ILogger<T> into services.
public class ReportGenerator : ITransientDependency
{
private readonly ILogger<ReportGenerator> _logger;
public ReportGenerator(ILogger<ReportGenerator> logger)
{
_logger = logger;
}
public void Generate()
{
_logger.LogInformation("Generating report");
}
}
ABP registers IInitLoggerFactory before normal module registration. IServiceCollection.GetInitLogger<T>() returns a buffered initialization logger from that factory, or NullLogger<T>.Instance if the factory is unavailable. DefaultInitLoggerFactory caches loggers by category and retains AbpInitLogEntry items until application initialization transfers them to the configured ILoggerFactory and clears them.
Use this only in infrastructure that must log while services are still being registered:
var logger = context.Services.GetInitLogger<MyAppModule>();
logger.LogDebug("Configuring module services");
No IObjectAccessor<ILogger>-based early logging registration exists in the ABP framework source. Do not document or add that older/unverified pattern.
Use ABP's ILogger.LogException(exception, optionalLevel) extension when logging an ABP exception outside the automatic exception pipeline. Without an explicit level it calls exception.GetLogLevel(); the default is Error, while BusinessException defaults to Warning through IHasLogLevel.
LogException also logs known IHasErrorCode/IHasErrorDetails properties, invokes IExceptionWithSelfLogging.Log(ILogger), and logs exception Data. Avoid following it with another LogError for the same exception.
ASP.NET Core exception middleware calls LogException unless an AbpExceptionHandlingOptions.ExcludeExceptionFromLoggerSelectors predicate excludes the exception.
The application template creates the static bootstrap logger before building the host, then bridges the host to Serilog:
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();
try
{
var builder = WebApplication.CreateBuilder(args);
builder.Host.UseSerilog();
await builder.AddApplicationAsync<MyAppModule>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
}
catch (Exception exception)
{
// The template rethrows HostAbortedException (e.g. from `dotnet ef`) instead of logging it as fatal.
if (exception is HostAbortedException)
{
throw;
}
Log.Fatal(exception, "Host terminated unexpectedly!");
}
finally
{
Log.CloseAndFlush();
}
The template uses .MinimumLevel.Debug() in DEBUG builds and .MinimumLevel.Information() otherwise, and rethrows HostAbortedException rather than logging it as fatal.
Keep provider-specific configuration in the host. Application and module code should normally depend on ILogger<T>, not Serilog's static Log API.
ILogger<T> logs reach the configured sink.BusinessException and verify automatic logging uses Warning unless explicitly changed.IExceptionWithSelfLogging exception and verify its additional log is emitted once.UseSerilog() is called before AddApplicationAsync/host build.IObjectAccessor<ILogger> — early logging uses IInitLoggerFactory and GetInitLogger<T>().ILogger<T> so provider choice stays at the host boundary.Log.CloseAndFlush() — asynchronous/file sinks can retain buffered events.What SKILL.md sets; muted values are Claude Code's defaults
/abp-infrastructure:configure-loggingfrom abp-infrastructure
npx claudepluginhub abpframework/abp-skills --plugin abp-infrastructure16 skills in this plugin
/check-simple-stateComposable ABP simple-state conditions on definitions and UI state objects. USE FOR: ISimpleStateChecker, ISimpleStateCheckerManager, permission/feature/authentication conditions on IHasSimpleStateCheckers. DO NOT USE FOR: tenant/edition feature values (manage-settings-and-features); permission authorization of a service call (permissions-and-authorization); startup-time module capabilities (toggle-global-features)./configure-audit-loggingABP audit logging: per-request log of requests, actions, entity change history, exceptions. USE FOR: enabling/disabling auditing, GET request logging, entity change history, AuditLogContributors, ignoring types, [Audited]/[DisableAuditing], manual scopes with IAuditingManager. DO NOT USE FOR: general application/UI logging or Serilog (configure-logging); setting/feature values (manage-settings-and-features); background jobs/workers/handlers (background-jobs-and-events)./encrypt-stringsABP IStringEncryptionService with compatible passphrase, salt, IV, key-size options. USE FOR: reversible encryption used by ABP infra; AbpStringEncryptionOptions defaults and config keys; Encrypt/Decrypt null behavior; encrypted setting values. DO NOT USE FOR: password hashing, signing, token generation, or crypto protocol design; defining encrypted ABP settings (manage-settings-and-features)./generate-guidsABP IGuidGenerator entity IDs and sequential GUID layout for the active database provider. USE FOR: IGuidGenerator.Create; SequentialGuidGenerator; SimpleGuidGenerator; AbpSequentialGuidGeneratorOptions.DefaultSequentialGuidType; SequentialAtEnd / SequentialAsString / SequentialAsBinary. DO NOT USE FOR: cache keys and invalidation (cache-entities); cryptographic tokens or secrets (encrypt-strings); schema and repository design./handle-dates-and-timeABP DateTime, UTC normalization, time zones, persistence. USE FOR: IClock and AbpClockOptions; Utc/Local/Unspecified; Clock.Normalize; EF Core DateTime converters and DisableDateTimeNormalization; per-request tenant/user timezone; ITimezoneProvider Windows/IANA. DO NOT USE FOR: timezone settings (manage-settings-and-features); audit-log persistence (configure-audit-logging); multi-tenancy resolution (configure-multi-tenancy)./integrate-aiABP AI workspaces with Microsoft.Extensions.AI, Microsoft Agent Framework, or Microsoft.SemanticKernel. USE FOR: choosing an ABP AI abstraction, AbpAIModule, AbpAIWorkspaceOptions, resolving IChatClient/IChatClientAccessor/IKernelAccessor, per-workspace provider/model config. DO NOT USE FOR: general .NET AI/ML outside ABP's workspace integration (out of scope); AI-call observability (out of scope); tenant-editable AI providers via the commercial AI Management module.Other plugins' skills for the same job