- Core Settings
- API Documentation
- Identity & Authentication
- Logging System
- API Versioning
- Database Settings
- Security Considerations
Default logging levels for the application:
{
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
Setting | Description | Values |
---|---|---|
Default |
General logging level | Trace , Debug , Information , Warning , Error , Critical |
Microsoft.AspNetCore |
Framework logging level | Trace , Debug , Information , Warning , Error , Critical |
Basic application identification:
{
"app": {
"name": "Place Profile Api"
}
}
Setting | Description |
---|---|
name |
Service identifier |
Host configuration:
{
"AllowedHosts": "*"
}
Setting | Description | Values |
---|---|---|
AllowedHosts |
Allowed host names | "*" or specific domains |
API documentation configuration: Refer to the project Place.Core.Swagger for more details.
{
"Swagger": {
"enabled": true,
"reDocEnabled": false,
"name": "v1",
"title": "Profile Api",
"version": "v1",
"routePrefix": "swagger",
"includeSecurity": true,
"apiVersions": ["1.0"]
}
}
Setting | Description | Default |
---|---|---|
enabled |
Enable Swagger | true |
reDocEnabled |
Enable ReDoc UI | false |
name |
API name | "v1" |
title |
UI title | "Profile Api" |
version |
API version | "v1" |
routePrefix |
URL prefix | "swagger" |
includeSecurity |
Security documentation | true |
apiVersions |
Supported versions | ["1.0"] |
Identity storage configuration: Refer to the project Place.Core.Identity for more
{
"Identity": {
"Database": {
"Host": "localhost",
"Port": 5489,
"Username": "postgres",
"Password": "postgres",
"Database": "PlaceApiIdentity"
}
}
}
Setting | Purpose | Default |
---|---|---|
Host |
Database server | "localhost" |
Port |
PostgreSQL port | 5489 |
Username |
DB user | "postgres" |
Password |
DB password | "postgres" |
Database |
DB name | "PlaceApiIdentity" |
Authentication configuration:
{
"Identity": {
"Authentication": {
"TokenExpiration": "01:00:00",
"RequireConfirmedEmail": true,
"RequireConfirmedAccount": false
}
}
}
Setting | Purpose | Default |
---|---|---|
TokenExpiration |
JWT validity | "01:00:00" |
RequireConfirmedEmail |
Email verification | true |
RequireConfirmedAccount |
Account verification | false |
Comprehensive logging configuration: Refer to the project Place.Core.Logging for more
{
"logger": {
"applicationName": "profile-service",
"excludePaths": ["/ping", "/metrics"],
"level": "information",
"console": {"enabled": true},
"file": {
"enabled": true,
"path": "logs/logs.txt",
"interval": "day"
},
"seq": {
"enabled": true,
"url": "http://localhost:5341",
"token": "secret"
}
}
}
Setting | Purpose | Default |
---|---|---|
enabled |
Enable console output | true |
Setting | Purpose | Default |
---|---|---|
enabled |
Enable file output | true |
path |
Log file location | "logs/logs.txt" |
interval |
Rotation period | "day" |
Setting | Purpose | Default |
---|---|---|
enabled |
Enable Seq | true |
url |
Seq server URL | "http://localhost:5341" |
token |
API key | "secret" |
Version control configuration: Refer to the project Place.Core.Versioning for more
{
"apiVersioning": {
"enabled": true,
"defaultVersion": "1.0",
"assumeDefaultVersionWhenUnspecified": true,
"reportApiVersions": true,
"versionReaderType": "All",
"headerName": "X-Api-Version",
"queryStringParam": "api-version"
}
}
Setting | Purpose | Default |
---|---|---|
enabled |
Enable versioning | true |
defaultVersion |
Fallback version | "1.0" |
assumeDefaultVersionWhenUnspecified |
Use default if unspecified | true |
reportApiVersions |
Show available versions | true |
versionReaderType |
Version source | "All" |
headerName |
Header field name | "X-Api-Version" |
queryStringParam |
Query parameter name | "api-version" |
Main database settings: Refer to the project Place.Core.Database for more
{
"Database": {
"Provider": "Postgres",
"Connection": {
"Host": "localhost",
"Port": 5489,
"Database": "PlaceApiProfile",
"Username": "postgres",
"Password": "postgres",
"CommandTimeout": 30,
"EnableRetryOnFailure": true,
"MaxRetryCount": 3,
"AdditionalParameters": {
"Pooling": "true",
"Maximum Pool Size": "100"
}
}
}
}
Setting | Purpose | Default |
---|---|---|
Provider |
Database type | "Postgres" |
Host |
Server address | "localhost" |
Port |
Server port | 5489 |
Database |
Database name | "PlaceApiProfile" |
CommandTimeout |
Query timeout (seconds) | 30 |
EnableRetryOnFailure |
Retry failed connections | true |
MaxRetryCount |
Maximum retries | 3 |
Pooling |
Connection pooling | "true" |
Maximum Pool Size |
Max connections | "100" |
Database migration configuration:
{
"Database": {
"Migration": {
"AutoMigrate": true,
"SeedData": true,
"MigrationsHistoryTableSchema": "public",
"IdempotentMigrations": true
}
}
}
Setting | Purpose | Default |
---|---|---|
AutoMigrate |
Auto-run migrations | true |
SeedData |
Initialize data | true |
MigrationsHistoryTableSchema |
History table schema | "public" |
IdempotentMigrations |
Safe reruns | true |
For production, replace sensitive data:
{
"Database": {
"Connection": {
"Password": "${DB_PASSWORD}"
}
}
}
Override settings per environment:
appsettings.Development.json
appsettings.Staging.json
appsettings.Production.json
-
Security
- Use environment variables
- Secure database credentials
- Appropriate token timeouts
-
Performance
- Configure pool sizes
- Set appropriate timeouts
- Optimize logging levels
-
Monitoring
- Enable necessary metrics
- Configure proper logging
- Set up health checks