Simple, lightweight alternative for centralized logging. Provides rich searching capabilities for structures logs while keeping minimal profile.
- Have IIS installed with AspNetCoreModuleV2 (Part of ASP.NET Core 5.0 Runtime Windows Hosting Bundle Installer)
- Pick Release binary (Don't pick single_file ones, IIS doesn't support them)
- Create IIS Site
- Copy content of release binary to created IIS site
- Configure Luger (see Configure section)
- Set Access rights for IIS User to be able to write to data folder "StorageDirectory"
- Start Site
Mind that IIS process must be able to write into StorageDirectory. By default it's ./luger-data in application root.
- Pick Release binary (preferably luger_single_file_runtime_linux-x64.tar.gz)
- Unpack (
tar -xvf ...
) the archive to /opt/luger_single_file_runtime_linux-x64 - Prepare unit file (example here) and copy it to directory where your SystemD units reside e.g.
/etc/systemd/system/luger.service
- Configure Luger (see Configure section)
systemctl enable luger
systemctl start luger
systemctl status luger
Single command run (good for looking around), contains preconfigured user and bucket.
username: admin
password: admin
docker pull meyhem/luger
docker run -p 7931:7931 --env Luger__Users__0__Id="admin" --env Luger__Users__0__Password="admin" --env Luger__Users__0__Buckets__0="bucket" --env Luger__Buckets__0__Id="bucket" --env Jwt__SigningKey="My secred password for JWT" meyhem/luger
Download example compose file as docker-compose.yml
It contains preconfigured user and bucket, if you want to access full JSON configuration see provisioning in Configure section.
docker-compose up
Luger already preconfigures most values for you in luger.json, it's up to you to do the rest.
This is minimal configuration that you can put into luger-override.json to get you started, it contains single admin user and one bucket.
{
"Jwt": {
"SigningKey": "your-signing-key-here" // <-- Fill in key to be used for JWT sign/verify
},
"Luger": {
"Users": [
// Create at least one user
{
"Id": "admin",
"Password": "admin",
// List of buckets this user has access to
"Buckets": ["project-1"]
}
],
"Buckets": [
// Create at least one bucket
{
// Bucket identifier (has strong naming policy, only chars "a-z0-9_-")
"Id": "project-1",
// Log retention in hours, older are deleted, 0 for infinite retention
"MaxRetentionHours": 5
}
]
}
}
Provisioning config override
Luger container accepts optional config override at path /config/luger-override.json where you can mount your volume with your config override file.
If running manually out of docker then based on your chosen release binary, there will be Luger.dll and/or Luger.exe present.
You can run the .exe directly, or run dll with dotnet Luger.dll
Note that you must configure at least one user and bucket first or Luger will refuse to start (ArgumentException)
C# Microsoft.Extensions.Logging Luger.LoggerProvider
JS // planned
Java // planned
Luger is configured via json files luger.json and luger-override.json.
Preferred place for your configuration is luger-override.json.
{
// Listening url for server
"Urls": "http://0.0.0.0:7931",
// Default logging options for Luger process, printed to STDOUT
"Logging": {
"LogLevel": {
"Default": "Information"
}
},
// JWT configuration used to authenticate Luger users
"Jwt": {
"Audience": "Luger",
"Issuer": "Luger",
"ExpiresSeconds": "3600",
"SigningKey": "your-signing-key-here" // <-- Be sure to provide your own key
},
// Luger options
"Luger": {
// How often should luger flush logs to files
"FlushIntervalSeconds": "5",
// Path to directory where Luger stores logs
"StorageDirectory": "./luger-data",
// List of users to be allowed to view logs
"Users": [
{
// User
"Id": "admin",
// Password
"Password": "admin",
// List of buckets this user has access to
"Buckets": ["project-1"]
}
],
// List of buckets that Luger will recognize
"Buckets": [
{
// Bucket identifier (has strong naming policy, only chars "a-z0-9_-")
"Id": "project-1",
// Log retention in hours, older are deleted, 0 for infinite retention
"MaxRetentionHours": 5
}
]
}
}
Mostly caused by invalid configuration, missing user or bucket. Message should guide you.
See Configure section
- no_runtime - Package doesn't contain .net runtime, you must install it on your hosting platform and start Luger via
dotnet Luger.dll
- runtime - larger package, but contain .net runtime, no need to install any
- single_file - package with dependencies packed into single file, should be preferred (might be incompatible with very old systems)
- win-x64 - only for 64-bit windows
- linux-x64 - only for 64-bit linux
- linux-arm - only for 32-bit arm linux
- linux-arm64 - only for 64-bit arm linux
- osx-x64 - only for 64-bit osx
Luger logs it's internal logs to stdout by default. To be able to view them on IIS we need to enable stdout logging.
- Open web.config present at site root
- Set
stdoutLogEnabled="true"
- Save
- Restart APP Pool & Site (or exec
iisreset
from Admin CLI) - Try to access application from browser again
- logs folder in site root should be created containing exception info (most likely you screwed up configuration, refer to Configure section)
docker build -t luger:latest .
docker run -p 7931:7931 luger
docker tag luger meyhem/luger:latest
docker push meyhem/luger:latest