mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 17:00:54 +01:00
* fix: skip env validation in dockerfile not working * fix: skip env validation in dockerfile not working * fix: remove linux/arm/v7 for now as node commands are run forever * fix: remove cache because it is to big? * refactor: remove redis log transport during build * fix: add more checks for conditional redis connection * fix: docker build not working locally * refactor: move base image to debian * chore: add arm v7 platform support * fix: remove armv7 support as not supported by turbo * chore: profile amd64 build * chore: enable webpack logging * chore: disable linux/arm64 for now * chore: remove profiling from build in dockerfile * chore: revert to node alpine image
22 lines
641 B
JavaScript
22 lines
641 B
JavaScript
import winston, { format, transports } from "winston";
|
|
|
|
import { RedisTransport } from "./redis-transport.mjs";
|
|
|
|
const logMessageFormat = format.printf(({ level, message, timestamp }) => {
|
|
return `${timestamp} ${level}: ${message}`;
|
|
});
|
|
|
|
const logTransports = [new transports.Console()];
|
|
|
|
// Only add the Redis transport if we are not in CI
|
|
if (!(Boolean(process.env.CI) || Boolean(process.env.DISABLE_REDIS_LOGS))) {
|
|
logTransports.push(new RedisTransport());
|
|
}
|
|
|
|
const logger = winston.createLogger({
|
|
format: format.combine(format.colorize(), format.timestamp(), logMessageFormat),
|
|
transports: logTransports,
|
|
});
|
|
|
|
export { logger };
|