mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-12 18:43:50 +00:00
refactor(#92): Move site-name into env var
This commit is contained in:
+3
-1
@@ -13,4 +13,6 @@ VITE_BREVO_SENDER_EMAIL="noreply@example.com"
|
||||
# Display name for the sender email
|
||||
VITE_BREVO_SENDER_NAME="No Reply"
|
||||
# Contact email for the contact page form to send to
|
||||
VITE_CONTACT_EMAIL=""
|
||||
VITE_CONTACT_EMAIL=""
|
||||
# Logger service name to identify this website
|
||||
VITE_LOGGER_SERVICE_NAME="example-site"
|
||||
@@ -1,6 +1,10 @@
|
||||
import { createLogger, transports, format } from 'winston';
|
||||
import { WinstonTransport as AxiomTransport } from '@axiomhq/winston';
|
||||
import { VITE_AXIOM_DATASET, VITE_AXIOM_TOKEN } from '$env/static/private';
|
||||
import {
|
||||
VITE_AXIOM_DATASET,
|
||||
VITE_AXIOM_TOKEN,
|
||||
VITE_LOGGER_SERVICE_NAME
|
||||
} from '$env/static/private';
|
||||
|
||||
const axiomTransport = new AxiomTransport({
|
||||
dataset: VITE_AXIOM_DATASET,
|
||||
@@ -9,7 +13,7 @@ const axiomTransport = new AxiomTransport({
|
||||
|
||||
const logger = createLogger({
|
||||
level: 'info',
|
||||
defaultMeta: { service: 'example-site' }, // Change this so you can identify your website if you have multiple logging into Axiom
|
||||
defaultMeta: { service: VITE_LOGGER_SERVICE_NAME }, // Change this so you can identify your website if you have multiple logging into Axiom
|
||||
format: format.combine(
|
||||
format.errors({ stack: true }), // Captures error stack traces
|
||||
format.timestamp(),
|
||||
|
||||
Reference in New Issue
Block a user