@@ -98,22 +98,18 @@ pub(crate) fn check_bootc_label(config: &ostree_ext::oci_spec::image::ImageConfi
98
98
{
99
99
match label. as_str ( ) {
100
100
crate :: metadata:: COMPAT_LABEL_V1 => { }
101
- o => crate :: journal:: journal_print (
102
- libsystemd:: logging:: Priority :: Warning ,
103
- & format ! (
101
+ o => {
102
+ tracing:: warn!(
104
103
"notice: Unknown {} value {}" ,
105
104
crate :: metadata:: BOOTC_COMPAT_LABEL ,
106
105
o
107
- ) ,
108
- ) ,
106
+ ) ;
107
+ }
109
108
}
110
109
} else {
111
- crate :: journal:: journal_print (
112
- libsystemd:: logging:: Priority :: Warning ,
113
- & format ! (
114
- "notice: Image is missing label: {}" ,
115
- crate :: metadata:: BOOTC_COMPAT_LABEL
116
- ) ,
110
+ tracing:: warn!(
111
+ "notice: Image is missing label: {}" ,
112
+ crate :: metadata:: BOOTC_COMPAT_LABEL
117
113
)
118
114
}
119
115
}
@@ -429,11 +425,24 @@ pub(crate) async fn pull_from_prepared(
429
425
let imgref_canonicalized = imgref. clone ( ) . canonicalize ( ) ?;
430
426
tracing:: debug!( "Canonicalized image reference: {imgref_canonicalized:#}" ) ;
431
427
428
+ // Log successful import completion
429
+ const IMPORT_COMPLETE_JOURNAL_ID : & str = "4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8" ;
430
+
431
+ tracing:: info!(
432
+ message_id = IMPORT_COMPLETE_JOURNAL_ID ,
433
+ bootc. image. reference = & imgref. image,
434
+ bootc. image. transport = & imgref. transport,
435
+ bootc. manifest_digest = import. manifest_digest. as_ref( ) ,
436
+ bootc. ostree_commit = & import. merge_commit,
437
+ "Successfully imported image: {}" ,
438
+ imgref
439
+ ) ;
440
+
432
441
if let Some ( msg) =
433
442
ostree_container:: store:: image_filtered_content_warning ( & import. filtered_files )
434
443
. context ( "Image content warning" ) ?
435
444
{
436
- crate :: journal :: journal_print ( libsystemd :: logging :: Priority :: Notice , & msg) ;
445
+ tracing :: info! ( "{}" , msg) ;
437
446
}
438
447
Ok ( Box :: new ( ( * import) . into ( ) ) )
439
448
}
@@ -447,8 +456,30 @@ pub(crate) async fn pull(
447
456
prog : ProgressWriter ,
448
457
) -> Result < Box < ImageState > > {
449
458
match prepare_for_pull ( repo, imgref, target_imgref) . await ? {
450
- PreparedPullResult :: AlreadyPresent ( existing) => Ok ( existing) ,
459
+ PreparedPullResult :: AlreadyPresent ( existing) => {
460
+ // Log that the image was already present (Debug level since it's not actionable)
461
+ const IMAGE_ALREADY_PRESENT_ID : & str = "5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9" ;
462
+ tracing:: debug!(
463
+ message_id = IMAGE_ALREADY_PRESENT_ID ,
464
+ bootc. image. reference = & imgref. image,
465
+ bootc. image. transport = & imgref. transport,
466
+ bootc. status = "already_present" ,
467
+ "Image already present: {}" ,
468
+ imgref
469
+ ) ;
470
+ Ok ( existing)
471
+ }
451
472
PreparedPullResult :: Ready ( prepared_image_meta) => {
473
+ // Log that we're pulling a new image
474
+ const PULLING_NEW_IMAGE_ID : & str = "6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0" ;
475
+ tracing:: info!(
476
+ message_id = PULLING_NEW_IMAGE_ID ,
477
+ bootc. image. reference = & imgref. image,
478
+ bootc. image. transport = & imgref. transport,
479
+ bootc. status = "pulling_new" ,
480
+ "Pulling new image: {}" ,
481
+ imgref
482
+ ) ;
452
483
Ok ( pull_from_prepared ( imgref, quiet, prog, * prepared_image_meta) . await ?)
453
484
}
454
485
}
@@ -466,6 +497,14 @@ pub(crate) async fn wipe_ostree(sysroot: Sysroot) -> Result<()> {
466
497
}
467
498
468
499
pub ( crate ) async fn cleanup ( sysroot : & Storage ) -> Result < ( ) > {
500
+ // Log the cleanup operation to systemd journal
501
+ const CLEANUP_JOURNAL_ID : & str = "2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6" ;
502
+
503
+ tracing:: info!(
504
+ message_id = CLEANUP_JOURNAL_ID ,
505
+ "Starting cleanup of old images and deployments"
506
+ ) ;
507
+
469
508
let bound_prune = prune_container_store ( sysroot) ;
470
509
471
510
// We create clones (just atomic reference bumps) here to move to the thread.
@@ -615,6 +654,20 @@ pub(crate) async fn stage(
615
654
spec : & RequiredHostSpec < ' _ > ,
616
655
prog : ProgressWriter ,
617
656
) -> Result < ( ) > {
657
+ // Log the staging operation to systemd journal with comprehensive upgrade information
658
+ const STAGE_JOURNAL_ID : & str = "8f7a2b1c3d4e5f6a7b8c9d0e1f2a3b4c" ;
659
+
660
+ tracing:: info!(
661
+ message_id = STAGE_JOURNAL_ID ,
662
+ bootc. image. reference = & spec. image. image,
663
+ bootc. image. transport = & spec. image. transport,
664
+ bootc. manifest_digest = image. manifest_digest. as_ref( ) ,
665
+ bootc. stateroot = stateroot,
666
+ "Staging image for deployment: {} (digest: {})" ,
667
+ spec. image,
668
+ image. manifest_digest
669
+ ) ;
670
+
618
671
let ostree = sysroot. get_ostree ( ) ?;
619
672
let mut subtask = SubTaskStep {
620
673
subtask : "merging" . into ( ) ,
@@ -773,19 +826,26 @@ pub(crate) async fn rollback(sysroot: &Storage) -> Result<()> {
773
826
let rollback_image = rollback_status
774
827
. query_image ( repo) ?
775
828
. ok_or_else ( || anyhow ! ( "Rollback is not container image based" ) ) ?;
776
- let msg = format ! ( "Rolling back to image: {}" , rollback_image. manifest_digest) ;
777
- libsystemd:: logging:: journal_send (
778
- libsystemd:: logging:: Priority :: Info ,
779
- & msg,
780
- [
781
- ( "MESSAGE_ID" , ROLLBACK_JOURNAL_ID ) ,
782
- (
783
- "BOOTC_MANIFEST_DIGEST" ,
784
- rollback_image. manifest_digest . as_ref ( ) ,
785
- ) ,
786
- ]
787
- . into_iter ( ) ,
788
- ) ?;
829
+
830
+ // Get current booted image for comparison
831
+ let current_image = host
832
+ . status
833
+ . booted
834
+ . as_ref ( )
835
+ . and_then ( |b| b. query_image ( repo) . ok ( ) ?) ;
836
+
837
+ tracing:: info!(
838
+ message_id = ROLLBACK_JOURNAL_ID ,
839
+ bootc. manifest_digest = rollback_image. manifest_digest. as_ref( ) ,
840
+ bootc. ostree_commit = & rollback_image. merge_commit,
841
+ bootc. rollback_type = if reverting { "revert" } else { "rollback" } ,
842
+ bootc. current_manifest_digest = current_image
843
+ . as_ref( )
844
+ . map( |i| i. manifest_digest. as_ref( ) )
845
+ . unwrap_or( "none" ) ,
846
+ "Rolling back to image: {}" ,
847
+ rollback_image. manifest_digest
848
+ ) ;
789
849
// SAFETY: If there's a rollback status, then there's a deployment
790
850
let rollback_deployment = deployments. rollback . expect ( "rollback deployment" ) ;
791
851
let new_deployments = if reverting {
@@ -833,6 +893,18 @@ fn find_newest_deployment_name(deploysdir: &Dir) -> Result<String> {
833
893
834
894
// Implementation of `bootc switch --in-place`
835
895
pub ( crate ) fn switch_origin_inplace ( root : & Dir , imgref : & ImageReference ) -> Result < String > {
896
+ // Log the in-place switch operation to systemd journal
897
+ const SWITCH_INPLACE_JOURNAL_ID : & str = "3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7" ;
898
+
899
+ tracing:: info!(
900
+ message_id = SWITCH_INPLACE_JOURNAL_ID ,
901
+ bootc. image. reference = & imgref. image,
902
+ bootc. image. transport = & imgref. transport,
903
+ bootc. switch_type = "in_place" ,
904
+ "Performing in-place switch to image: {}" ,
905
+ imgref
906
+ ) ;
907
+
836
908
// First, just create the new origin file
837
909
let origin = origin_from_imageref ( imgref) ?;
838
910
let serialized_origin = origin. to_data ( ) ;
0 commit comments