No description
Find a file
2025-06-23 14:16:43 +02:00
.idea/config format 2025-06-23 14:16:43 +02:00
Ramboe.Logging format 2025-06-23 14:16:43 +02:00
Ramboe.Logging.Blazor format 2025-06-23 14:16:43 +02:00
Ramboe.Logging.DependencyInjection format 2025-06-23 14:16:43 +02:00
Ramboe.Logging.Server format 2025-06-23 14:16:43 +02:00
SolutionItems/Deployment adjusted docker-compose files to use new image 2023-09-30 13:10:51 +02:00
WebService1 format 2025-06-23 14:16:43 +02:00
.gitignore init 2023-09-30 10:29:05 +02:00
Ramboe.Logging.sln refactored docker-compose.yml, also added a non-traefik version 2023-09-30 13:02:03 +02:00
README.md Create README.md 2023-09-30 13:37:18 +02:00

Description

Ramboe.Logging is an ecosystem which consists of a postgresql database container (to write logs into) and an aspnet core hosted blazor webassembly to display the logs from postgresql.

Check out the Ramboe.Logging.DependencyInjection nuget package, so you can actually write some logs from your aspnet core webservices

Deploy the Ramboe.Logging ecosystem to your environment

Prerequisites

linux machine with docker + docker-compose installed

On your linux machine

create directory /mnt/compose

mkdir /mnt/compose/

copy '.env' + 'docker-compose' from this github repository's deployment folder into /mnt/compose (or create the files and copy the following code into)

docker-compose.yml

# This docker-compose file will deploy the ramboe.logging ecosystem which consists of a postgresql database container (to write logs into) and an aspnet core hosted blazor webassembly to display the logs from postgresql.

# When executing the docker-compose file, make sure to supply a '.env' file (that contains values for POSTGRES_USER and POSTGRES_PASSWORD) in the same directory

# In addition the ramboe.logging ecosystem, this docker-compose file also deploys a traefik instance for automatic SSL certificate creation and routing. Look for the 'adjust' marker to know where to put your own data in.

version: "3.3"

services:
  
  # Reverse Proxy +  SSL cert generation
  traefik:
    image: "traefik:v2.10"
    container_name: "traefik"
    command:
      # foundation [don't touch]
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.myresolver.acme.tlschallenge=true"
      - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
      
      # the email connected to your domain
      - "--certificatesresolvers.myresolver.acme.email=your.mail@here.com" adjust
    # ports [don't touch]
    ports:
      - "443:443"
      - "80:80"
    # volumes [don't touch]
    volumes:
      - "./letsencrypt:/letsencrypt"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    labels:
      # Dashboard
      - "traefik.enable=true"

      - "traefik.http.routers.traefik.rule=Host(`traefik.logging.ramboe.de`)" adjust
      - "traefik.http.routers.traefik.entrypoints=websecure"
      - "traefik.http.routers.traefik.tls.certresolver=myresolver"
      
      # global redirect to https [don't touch]
      - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
      - "traefik.http.routers.http-catchall.entrypoints=web"
      - "traefik.http.routers.http-catchall.middlewares=redirect-to-https"

      # middleware redirect [don't touch]
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
  
  # Blazor Server, hosting WASM, talking to Logging db
  blazor-server-with-wasm:
    image: "ramboe/ramboe-logging-blazor-server:1.0.0" adjust (if you want to use your own image)
    container_name: "blazor-server-with-wasm"
    depends_on:
      - logging-db
    ports:
      - "80"
    environment:
      - ASPNETCORE_ENVIRONMENT=Production
      - "ConnectionStrings:Logging=Host=logging-db; Port=5432; Database=postgres; Username=${POSTGRES_USER}; Password=${POSTGRES_PASSWORD}"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.blazor-server-with-wasm.rule=Host(`logging.ramboe.de`)" adjust -  Change the host url here
      - "traefik.http.routers.blazor-server-with-wasm.entrypoints=websecure"
      - "traefik.http.routers.blazor-server-with-wasm.tls.certresolver=myresolver"
  
  # postgres sql container
  logging-db:
    container_name: "logging-db"
    image: postgres:14.1-alpine
    restart: always
    environment: adjust
      - POSTGRES_USER=${POSTGRES_USER:-postgres}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
    ports:
      - '5432:5432'
    volumes:
      - db:/var/lib/postgresql/data

volumes:
  db:
    driver: local

.env

POSTGRES_USER=postgres
POSTGRES_PASSWORD=mypassword

then

docker-compose up -d

Accessing RamboeLogs

you can now use the url to this machine (which is set with the docker-compose file, if traefik is used) to access the blazor frontend and also for the connection string to the postgresqldb

Write ramboe logs from your application

Check out the Ramboe.Logging.DependencyInjection nuget package, so you can actually write some logs from your aspnet core webservices