File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ RUN touch /app/.env.local
2121
2222USER root
2323RUN apt-get update
24- RUN apt-get install -y libgomp1 libcurl4
24+ RUN apt-get install -y libgomp1 libcurl4 curl dnsutils
2525
2626# ensure npm cache dir exists before adjusting ownership
2727RUN mkdir -p /home/user/.npm && chown -R 1000:1000 /home/user/.npm
Original file line number Diff line number Diff line change @@ -15,4 +15,12 @@ if (dev) {
1515 } ;
1616}
1717
18- export const logger = pino ( { ...options , level : config . LOG_LEVEL || "info" } ) ;
18+ export const logger = pino ( {
19+ ...options ,
20+ level : config . LOG_LEVEL || "info" ,
21+ formatters : {
22+ level : ( label ) => {
23+ return { level : label } ;
24+ } ,
25+ } ,
26+ } ) ;
Original file line number Diff line number Diff line change 11import { error } from "@sveltejs/kit" ;
2+ import { logger } from "$lib/server/logger.js" ;
23
34const MAX_FILE_SIZE = 10 * 1024 * 1024 ; // 10MB
45const FETCH_TIMEOUT = 30000 ; // 30 seconds
@@ -87,11 +88,14 @@ export async function GET({ url, fetch }) {
8788 } catch ( err ) {
8889 if ( err instanceof Error ) {
8990 if ( err . name === "AbortError" ) {
91+ logger . error ( err , `Request timeout` ) ;
9092 throw error ( 504 , "Request timeout" ) ;
9193 }
92- console . error ( "Error fetching URL:" , err ) ;
94+
95+ logger . error ( err , `Error fetching URL` ) ;
9396 throw error ( 500 , `Failed to fetch URL: ${ err . message } ` ) ;
9497 }
98+ logger . error ( err , `Error fetching URL` ) ;
9599 throw error ( 500 , "Failed to fetch URL" ) ;
96100 }
97101}
You can’t perform that action at this time.
0 commit comments