@@ -33,7 +33,9 @@ export class LogFileReader {
3333
3434 try {
3535 // First, try to get file info to determine the file size
36+ this . logger . debug ( `Attempting stat for file: ${ filename } ` ) ;
3637 const stat = await this . webdavClient . stat ( filename ) ;
38+ this . logger . debug ( `Stat successful for ${ filename } :` , stat ) ;
3739 const fileSize = ( stat as any ) . size ;
3840
3941 if ( ! fileSize || fileSize <= maxBytes ) {
@@ -48,7 +50,13 @@ export class LogFileReader {
4850 return await this . getRangeFileContents ( filename , startByte , fileSize - 1 ) ;
4951
5052 } catch ( statError ) {
51- this . logger . warn ( `Failed to get file stats for ${ filename } , falling back to full file:` , statError ) ;
53+ const error = statError as Error ;
54+ this . logger . warn ( `Failed to get file stats for ${ filename } , falling back to full file. Error:` , {
55+ message : error . message ,
56+ name : error . name ,
57+ code : ( error as any ) . code ,
58+ status : ( error as any ) . status ,
59+ } ) ;
5260 return await this . getFullFileContents ( filename ) ;
5361 }
5462 }
@@ -81,7 +89,9 @@ export class LogFileReader {
8189
8290 try {
8391 // First, try to get file info to determine the file size
92+ this . logger . debug ( `Attempting stat for file: ${ filename } ` ) ;
8493 const stat = await this . webdavClient . stat ( filename ) ;
94+ this . logger . debug ( `Stat successful for ${ filename } :` , stat ) ;
8595 const fileSize = ( stat as any ) . size ;
8696
8797 if ( ! fileSize || fileSize <= maxBytes ) {
@@ -95,7 +105,13 @@ export class LogFileReader {
95105 return await this . getRangeFileContents ( filename , 0 , maxBytes - 1 ) ;
96106
97107 } catch ( statError ) {
98- this . logger . warn ( `Failed to get file stats for ${ filename } , falling back to full file with truncation:` , statError ) ;
108+ const error = statError as Error ;
109+ this . logger . warn ( `Failed to get file stats for ${ filename } , falling back to full file with truncation. Error:` , {
110+ message : error . message ,
111+ name : error . name ,
112+ code : ( error as any ) . code ,
113+ status : ( error as any ) . status ,
114+ } ) ;
99115 // Fallback to reading full file and truncating
100116 const content = await this . getFullFileContents ( filename ) ;
101117 if ( content . length > maxBytes ) {
0 commit comments