File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -90,4 +90,6 @@ ENV BODY_SIZE_LIMIT=15728640
9090COPY --from=builder --chown=1000 /app/build /app/build
9191COPY --from=builder --chown=1000 /app/node_modules /app/node_modules
9292
93+ RUN apt -y update && apt-get install -y curl dnsutils
94+
9395CMD ["/bin/bash" , "-c" , "/app/entrypoint.sh" ]
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