Database Configuration

Database Configuration

This article will detail configuration of the Logship database.

The database is the backbone of any logship deployment. Configuration is specified between the database and backend sections, each providing configurable services with a wide range of capabilities.

You can find an example configuration here or in the logship deployments repository on GitHub.

Example

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "agent": {
    "udpMetricsEndpoint": "host.docker.internal:49999"
  },
  "database": {
    "enable": true,
    "master": {
      "enable": true
    },
    "endpoints": {
      "worker": ["net.tcp://0.0.0.0:6000"],
      "master": ["net.tcp://127.0.0.1:6000"]
    },
    "services": {
      "keyvalue": {
        "enable": true,
        "dataPath": "/logship/kvs"
      },
      "transactionManager": {
        "enable": true
      },
      "transactionLog": {
        "enable": true,
        "disk": {
          "enable": true,
          "path": "/logship/tlog"
        },
        "memory": {
          "enable": false
        }
      },
      "gateway": {
        "enable": true
      },
      "partitionManager": {
        "enable": true
      }
    }
  },
  "backend": {
    "enable": true,
    "endpoints": {
      "worker": ["net.tcp://0.0.0.0:6002"],
      "master": ["net.tcp://127.0.0.1:6002"]
    },
    "database": {
      "worker": ["net.tcp://127.0.0.1:6000"],
      "master": ["net.tcp://127.0.0.1:6000"]
    },
    "services": {
      "configService": {
        "enable": true
      },
      "inflowService": {
        "enable": true
      },
      "collectorService": {
        "enable": true,
        "tempPath": "/logship/tmp/"
      },
      "searchExecutorService": {
        "enable": true,
        "dataPath": "/logship/searchdata/",
        "minimumFreeSpaceBytes": 5368709120,
        "minimumFreeSpacePercentage": 15.0
      },
      "searchQueryService": {
        "enable": true
      },
      "accountsService": {
        "enable": true,
        "jwt": {
          "enable": true,
          "issuer": "logship-example",
          "audience": "logship-example",
          "signingKey": "this is a secret signing key for locally-signed JWT tokens"
        },
        "oauth": {
          "enable": false
        }
      },
      "messengerService": {
        "enable": true
      },
      "dashboardService": {
        "enable": true
      },
      "evaluatorManagerService": {
        "enable": true
      },
      "evaluatorRunnerService": {
        "enable": true
      },
      "setupService": {
        "enable": true,
        "provision": true,
        "accounts": [
          {
            "accountId": "00000000-0000-0000-0000-000000000000",
            "accountName": "Default Account"
          }
        ],
        "users": [
          {
            "userId": "00000000-0000-0000-0000-00000000cafe",
            "username": "admin",
            "password": "admin",
            "firstname": "Logship",
            "lastname": "Admin",
            "email": "admin@logship.io",
            "defaultGlobalPermissions": [
              "Logship.Global.Admin"
            ],
            "defaultAccounts": [
              {
                "accountName": "Default Account",
                "userPermissions": [
                  "Logship.Account.Admin"
                ]
              }
            ]
          }
        ]
      }
    },
    "master": {
      "enable": true
    }
  }
}

Config validation can be ignored for services with enable: false.

Production defaults

  • Pin explicit image tags (e.g., ghcr.io/logship-io/logship-database:0.8.0) and roll forward deliberately.
  • Persist /logship on SSD/NVMe; separate data/log volumes when possible.
  • Keep minimumFreeSpaceBytes above 5 GB and minimumFreeSpacePercentage above 15% to avoid throttling.
  • Run distinct masters for backend and database on separate nodes when scaling horizontally.
  • Secure endpoints with network ACLs and TLS offload (via reverse proxy) where required.

Logging

See .NET Logging Configuration for more information.

LogLevel

PropertyTypeRequiredDescription
DefaultStringYesSpecifies the default log level.
Microsoft.Hosting.LifetimeStringYesSpecifies the log level for Microsoft.Hosting.Lifetime.

agent

PropertyTypeRequiredDescription
udpMetricsEndpointStringYesSpecifies the UDP metrics endpoint.

database

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the database.
masterBooleanYesEnables or disables the master database.
endpointsObjectYesDefines endpoints for worker and master.
servicesObjectYesDefines various database services.

endpoints

worker

ValueTypeRequiredDescription
String[]YesSpecifies the worker endpoints.

master

ValueTypeRequiredDescription
String[]YesSpecifies the master endpoints.

services

keyvalue

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the keyvalue service.
dataPathStringYesSpecifies the data path for keyvalue service.

transactionManager

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the transaction manager service.

transactionLog

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the transaction log service.
diskObjectYesDefines disk settings for the transaction log service.
memoryObjectYesDefines memory settings for the transaction log service.
disk
PropertyTypeRequiredDescription
enableBooleanNoEnables or disables disk storage for the transaction log.
pathStringYesSpecifies the path for disk storage of the transaction log.
memory
PropertyTypeRequiredDescription
enableBooleanNoEnables or disables memory storage for the transaction log.

gateway

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the gateway service.

partitionManager

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the partition manager service.

backend

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the backend service.
endpointsObjectYesDefines endpoints for worker and master.
databaseObjectYesDefines database settings for worker and master.
servicesObjectYesDefines various backend services.
masterBooleanYesEnables or disables the master backend service.

endpoints

worker

ValueTypeRequiredDescription
String[]YesSpecifies the worker endpoints.

master

ValueTypeRequiredDescription
String[]YesSpecifies the master endpoints.

database

worker

ValueTypeRequiredDescription
String[]YesSpecifies the worker database endpoint.

master

ValueTypeRequiredDescription
String[]YesSpecifies the master database endpoint.

services

configService

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the config service.

inflowService

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the inflow service.

collectorService

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the collector service.
tempPathStringYesSpecifies the temporary path for the collector service.

searchExecutorService

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the search executor service.
dataPathStringYesSpecifies the data path for the search executor service.
minimumFreeSpaceBytesNumberYesSpecifies the minimum free space in bytes for the search executor service.
minimumFreeSpacePercentageNumberYesSpecifies the minimum free space percentage for the search executor service.

searchQueryService

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the search query service.

accountsService

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the accounts service.
jwtObjectYesDefines JWT settings for the accounts service.
oauthObjectYesDefines OAuth settings for the accounts service.
jwt
PropertyTypeRequiredDescription
enableBooleanNoEnables or disables JWT for the accounts service.
issuerStringYesSpecifies the issuer for JWT tokens.
audienceStringYesSpecifies the audience for JWT tokens.
signingKeyStringYesSpecifies the signing key for JWT tokens.
oauth
PropertyTypeRequiredDescription
enableBooleanNoEnables or disables OAuth for the accounts service.
clientIdStringYesThe OAuth Client Id
scopeStringYesOAuth Logship Scope
metadataAddressStringYesOAuth Metadata Address
authorityStringYesOAuth Authority
tokenEndpointStringYesOAuth Token Endpoint
authorizeEndpointStringYesOAuth Authorizer Endpoint
deviceEndpointStringYesOAuth Device Endpoint
validIssuersString[]YesOAuth Token Issuers
validAudiencesString[]YesOAuth Token Audiences (typically your Client Id)
createDefaultUserBooleanYesCreate a user for new OAuth logins?
defaultUserAccountStringYesIf creating a default user, the account ID for the new user
userIdClaimTypeStringNoIf creating a default user, the token claim for a User ID
firstNameClaimTypeStringNoIf creating a default user, the token claim for a User First Name
lastNameClaimTypeStringNoIf creating a default user, the token claim for a User Last Name
emailClaimTypeStringNoIf creating a default user, the token claim for a User Email

messengerService

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the messenger service.

dashboardService

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the dashboard service.

evaluatorManagerService

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the evaluator manager service.

evaluatorRunnerService

PropertyTypeRequiredDescription
enableBooleanNoEnables or disables the evaluator runner service.

setupService

The setup service can optionally provision accounts and users on startup (useful for local/dev and automation).

PropertyTypeRequiredDescription
enableBooleanYesEnables or disables the setup service.
provisionBooleanYesWhen true, provisions configured accounts/users on startup.
accountsObject[]NoAccounts to create/ensure exist (when provision: true).
usersObject[]NoUsers to create/ensure exist (when provision: true).
dashboardProvisioningPathStringNoOptional path containing dashboard provisioning files.
accounts[]
PropertyTypeRequiredDescription
accountIdStringYesAccount id to create/ensure exists.
accountNameStringYesHuman-friendly account name.
overrideBooleanNoRe-provision the account even if it already exists.
users[]
PropertyTypeRequiredDescription
userIdStringYesUser id to create/ensure exists.
usernameStringYesUsername for password login.
passwordStringYesPassword for password login.
firstnameStringYesFirst name.
lastnameStringYesLast name.
emailStringYesEmail address.
overrideBooleanNoRe-provision the user even if it already exists.
defaultGlobalPermissionsString[]NoGlobal permissions granted to the user.
defaultAccountsObject[]NoAccounts the user should be added to.
users[].defaultAccounts[]
PropertyTypeRequiredDescription
accountNameStringYesThe account name to add the user to (must exist in accounts[]).
userPermissionsString[]NoPermissions granted to the user in that account.

master

PropertyTypeRequiredDescription
enableBooleanYesEnables or disables the master backend service.