Table of Contents

MibCoreConfig

Introduction

This configuration is the base applied in all web api solutions. With it, we can enable settings common to all services of this type.

Keys

EnableSwagger -> Enable Swagger false
SwaggerRouteDisplayName -> Swagger route display name null
EnableMetrics -> Enable metric generation http false
UseProxy -> Enable proxy use AppSettings->CustomSettings:UseProxy
CustomUrlBase -> Define the custom base url AppSettings->CustomSettings:UseProxy
EnableMicrosoftLogging -> Enable Logging from Microsoft providers true
EnableMibLogProvider -> Enable MibLog provider true
EnableHttpLogging -> Enable HTTP logging false
HttpLoggingOptionsHeadersAllowed -> HTTP request headers that are allowed to be logged (separeted by ';') Accept;AcceptCharset;ContentLength;ContentType;ETag;X-Request-ID
HttpLoggingOptionsLoggingFields -> HTTP fields are allowed to be logged (separeted by ';') null
HttpLoggingOptionsMediaType -> Provides configuration for selecting which encoding to use for a specific media type. application/json
HttpLoggingOptionsBodyLogLimit -> Maximum (request and response) body size to log (in bytes). 4096
UseSimpleHealthCheck -> Use a simple health check to validate just that service false
Timeout -> The timespan to wait before the request times out in seconds. 60
EnableSerilog -> Enable Serilog true
SerilogApplicationName -> Application name current assembly name
SerilogVersion -> Application version current assembly version
SerilogFolder -> Folder name to save the log logs
SerilogFileName -> File name to save the log MibLog_Serilog-
SerilogTraceKey -> Type of tracekey using in log request_id
SerilogAppendScopeToLogTemplate -> List of itens to append in log template null
SerilogConsoleThemeEnabled -> Configure if console theme will be used true
SerilogConsoleAsyncEnabled -> Configure if console async will be used true
SerilogConsoleAsyncBlockWhenFull -> Configure if console async block when full will be used false
SerilogMessageMaxLength -> Configure the max length from message 5000
SerilogExceptionMaxLength -> Configure the max length from exception message 5000
SerilogScopeMaxLength -> Configure the max length from scope 5000
SerilogConsoleAsyncBufferSize -> Configure the max buffer size applied in console 1000
SerilogLogLevel -> Configure the log level will be applied based in MibSerilogLogLevel 2 (0 - Verbose, 1 - Debug, 2 - Information, 3 - Warning, 4 - Error, 5 - Fatal)
SerilogMicrosoftLogLevel -> Configure the Microsoft log level will be applied based in MibSerilogLogLevel 3 (0 - Verbose, 1 - Debug, 2 - Information, 3 - Warning, 4 - Error, 5 - Fatal)
SerilogTraceTag -> Configure the log type will be applied based in MibSerilogTracetag 0 (0 - RequestId, 1 - CorrelationId)
SerilogLogType -> onfigure the log type will be applied based in MibSerilogLogType 2 (0 - StdOut, 1 - LogFiles, 2 - All)
SerilogPathsShouldNotBeRegistered -> onfigures the paths of endpoints that should not be registered (separeted by ';', ',') null
SerilogLogHeadersStrategy -> Configures strategy used to log headers 0 (0 - None, 1 - All, 2 - OnlySpecified)
SerilogLogHeaders -> Configures the headers that should be logged (separeted by ';', ',') null

Examples

MIBCORECONFIG_DEFAULT_ENABLESWAGGER: true
MIBCORECONFIG_DEFAULT_ENABLESERILOG: false
MIBCORECONFIG_DEFAULT_TIMEOUT: 120