File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ pub fn init_logging(
270
270
EnvFilterBuilder :: new ( )
271
271
. filter ( Some ( "databend::log::query" ) , LevelFilter :: Trace ) ,
272
272
) )
273
- . append ( query_log_file) ;
273
+ . append ( query_log_file. with_layout ( get_layout ( "identical" ) ) ) ;
274
274
logger = logger. dispatch ( dispatch) ;
275
275
}
276
276
if let Some ( endpoint) = & cfg. query . otlp {
@@ -312,7 +312,7 @@ pub fn init_logging(
312
312
EnvFilterBuilder :: new ( )
313
313
. filter ( Some ( "databend::log::profile" ) , LevelFilter :: Trace ) ,
314
314
) )
315
- . append ( profile_log_file) ;
315
+ . append ( profile_log_file. with_layout ( get_layout ( "identical" ) ) ) ;
316
316
logger = logger. dispatch ( dispatch) ;
317
317
}
318
318
if let Some ( endpoint) = & cfg. profile . otlp {
Original file line number Diff line number Diff line change @@ -49,10 +49,15 @@ pub fn get_layout(format: &str) -> Layout {
49
49
match format {
50
50
"text" => text_layout ( ) ,
51
51
"json" => json_layout ( ) ,
52
+ "identical" => identical_layout ( ) ,
52
53
_ => unimplemented ! ( "file logging format {format} is not supported" ) ,
53
54
}
54
55
}
55
56
57
+ fn identical_layout ( ) -> Layout {
58
+ CustomLayout :: new ( |record : & Record | Ok ( format ! ( "{}\n " , record. args( ) ) . into_bytes ( ) ) ) . into ( )
59
+ }
60
+
56
61
fn text_layout ( ) -> Layout {
57
62
CustomLayout :: new ( |record : & Record | {
58
63
let s = match ThreadTracker :: query_id ( ) {
You can’t perform that action at this time.
0 commit comments