@@ -429,11 +429,24 @@ pub(crate) async fn pull_from_prepared(
429
429
let imgref_canonicalized = imgref. clone ( ) . canonicalize ( ) ?;
430
430
tracing:: debug!( "Canonicalized image reference: {imgref_canonicalized:#}" ) ;
431
431
432
+ // Log successful import completion
433
+ const IMPORT_COMPLETE_JOURNAL_ID : & str = "4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8" ;
434
+
435
+ tracing:: info!(
436
+ message_id = IMPORT_COMPLETE_JOURNAL_ID ,
437
+ bootc. image. reference = & imgref. image,
438
+ bootc. image. transport = & imgref. transport,
439
+ bootc. manifest_digest = import. manifest_digest. as_ref( ) ,
440
+ bootc. ostree_commit = & import. merge_commit,
441
+ "Successfully imported image: {}" ,
442
+ imgref
443
+ ) ;
444
+
432
445
if let Some ( msg) =
433
446
ostree_container:: store:: image_filtered_content_warning ( & import. filtered_files )
434
447
. context ( "Image content warning" ) ?
435
448
{
436
- crate :: journal :: journal_print ( libsystemd :: logging :: Priority :: Notice , & msg) ;
449
+ tracing :: info! ( "{}" , msg) ;
437
450
}
438
451
Ok ( Box :: new ( ( * import) . into ( ) ) )
439
452
}
@@ -447,8 +460,30 @@ pub(crate) async fn pull(
447
460
prog : ProgressWriter ,
448
461
) -> Result < Box < ImageState > > {
449
462
match prepare_for_pull ( repo, imgref, target_imgref) . await ? {
450
- PreparedPullResult :: AlreadyPresent ( existing) => Ok ( existing) ,
463
+ PreparedPullResult :: AlreadyPresent ( existing) => {
464
+ // Log that the image was already present (Debug level since it's not actionable)
465
+ const IMAGE_ALREADY_PRESENT_ID : & str = "5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9" ;
466
+ tracing:: debug!(
467
+ message_id = IMAGE_ALREADY_PRESENT_ID ,
468
+ bootc. image. reference = & imgref. image,
469
+ bootc. image. transport = & imgref. transport,
470
+ bootc. status = "already_present" ,
471
+ "Image already present: {}" ,
472
+ imgref
473
+ ) ;
474
+ Ok ( existing)
475
+ }
451
476
PreparedPullResult :: Ready ( prepared_image_meta) => {
477
+ // Log that we're pulling a new image
478
+ const PULLING_NEW_IMAGE_ID : & str = "6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0" ;
479
+ tracing:: info!(
480
+ message_id = PULLING_NEW_IMAGE_ID ,
481
+ bootc. image. reference = & imgref. image,
482
+ bootc. image. transport = & imgref. transport,
483
+ bootc. status = "pulling_new" ,
484
+ "Pulling new image: {}" ,
485
+ imgref
486
+ ) ;
452
487
Ok ( pull_from_prepared ( imgref, quiet, prog, * prepared_image_meta) . await ?)
453
488
}
454
489
}
@@ -466,6 +501,14 @@ pub(crate) async fn wipe_ostree(sysroot: Sysroot) -> Result<()> {
466
501
}
467
502
468
503
pub ( crate ) async fn cleanup ( sysroot : & Storage ) -> Result < ( ) > {
504
+ // Log the cleanup operation to systemd journal
505
+ const CLEANUP_JOURNAL_ID : & str = "2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6" ;
506
+
507
+ tracing:: info!(
508
+ message_id = CLEANUP_JOURNAL_ID ,
509
+ "Starting cleanup of old images and deployments"
510
+ ) ;
511
+
469
512
let bound_prune = prune_container_store ( sysroot) ;
470
513
471
514
// We create clones (just atomic reference bumps) here to move to the thread.
@@ -615,6 +658,20 @@ pub(crate) async fn stage(
615
658
spec : & RequiredHostSpec < ' _ > ,
616
659
prog : ProgressWriter ,
617
660
) -> Result < ( ) > {
661
+ // Log the staging operation to systemd journal with comprehensive upgrade information
662
+ const STAGE_JOURNAL_ID : & str = "8f7a2b1c3d4e5f6a7b8c9d0e1f2a3b4c" ;
663
+
664
+ tracing:: info!(
665
+ message_id = STAGE_JOURNAL_ID ,
666
+ bootc. image. reference = & spec. image. image,
667
+ bootc. image. transport = & spec. image. transport,
668
+ bootc. manifest_digest = image. manifest_digest. as_ref( ) ,
669
+ bootc. stateroot = stateroot,
670
+ "Staging image for deployment: {} (digest: {})" ,
671
+ spec. image,
672
+ image. manifest_digest
673
+ ) ;
674
+
618
675
let ostree = sysroot. get_ostree ( ) ?;
619
676
let mut subtask = SubTaskStep {
620
677
subtask : "merging" . into ( ) ,
@@ -773,19 +830,26 @@ pub(crate) async fn rollback(sysroot: &Storage) -> Result<()> {
773
830
let rollback_image = rollback_status
774
831
. query_image ( repo) ?
775
832
. 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
- ) ?;
833
+
834
+ // Get current booted image for comparison
835
+ let current_image = host
836
+ . status
837
+ . booted
838
+ . as_ref ( )
839
+ . and_then ( |b| b. query_image ( repo) . ok ( ) ?) ;
840
+
841
+ tracing:: info!(
842
+ message_id = ROLLBACK_JOURNAL_ID ,
843
+ bootc. manifest_digest = rollback_image. manifest_digest. as_ref( ) ,
844
+ bootc. ostree_commit = & rollback_image. merge_commit,
845
+ bootc. rollback_type = if reverting { "revert" } else { "rollback" } ,
846
+ bootc. current_manifest_digest = current_image
847
+ . as_ref( )
848
+ . map( |i| i. manifest_digest. as_ref( ) )
849
+ . unwrap_or( "none" ) ,
850
+ "Rolling back to image: {}" ,
851
+ rollback_image. manifest_digest
852
+ ) ;
789
853
// SAFETY: If there's a rollback status, then there's a deployment
790
854
let rollback_deployment = deployments. rollback . expect ( "rollback deployment" ) ;
791
855
let new_deployments = if reverting {
@@ -833,6 +897,18 @@ fn find_newest_deployment_name(deploysdir: &Dir) -> Result<String> {
833
897
834
898
// Implementation of `bootc switch --in-place`
835
899
pub ( crate ) fn switch_origin_inplace ( root : & Dir , imgref : & ImageReference ) -> Result < String > {
900
+ // Log the in-place switch operation to systemd journal
901
+ const SWITCH_INPLACE_JOURNAL_ID : & str = "3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7" ;
902
+
903
+ tracing:: info!(
904
+ message_id = SWITCH_INPLACE_JOURNAL_ID ,
905
+ bootc. image. reference = & imgref. image,
906
+ bootc. image. transport = & imgref. transport,
907
+ bootc. switch_type = "in_place" ,
908
+ "Performing in-place switch to image: {}" ,
909
+ imgref
910
+ ) ;
911
+
836
912
// First, just create the new origin file
837
913
let origin = origin_from_imageref ( imgref) ?;
838
914
let serialized_origin = origin. to_data ( ) ;
0 commit comments