@@ -429,11 +429,24 @@ pub(crate) async fn pull_from_prepared(
429429 let imgref_canonicalized = imgref. clone ( ) . canonicalize ( ) ?;
430430 tracing:: debug!( "Canonicalized image reference: {imgref_canonicalized:#}" ) ;
431431
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+
432445 if let Some ( msg) =
433446 ostree_container:: store:: image_filtered_content_warning ( & import. filtered_files )
434447 . context ( "Image content warning" ) ?
435448 {
436- crate :: journal :: journal_print ( libsystemd :: logging :: Priority :: Notice , & msg) ;
449+ tracing :: info! ( "{}" , msg) ;
437450 }
438451 Ok ( Box :: new ( ( * import) . into ( ) ) )
439452}
@@ -447,8 +460,30 @@ pub(crate) async fn pull(
447460 prog : ProgressWriter ,
448461) -> Result < Box < ImageState > > {
449462 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+ }
451476 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+ ) ;
452487 Ok ( pull_from_prepared ( imgref, quiet, prog, * prepared_image_meta) . await ?)
453488 }
454489 }
@@ -466,6 +501,14 @@ pub(crate) async fn wipe_ostree(sysroot: Sysroot) -> Result<()> {
466501}
467502
468503pub ( 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+
469512 let bound_prune = prune_container_store ( sysroot) ;
470513
471514 // We create clones (just atomic reference bumps) here to move to the thread.
@@ -615,6 +658,20 @@ pub(crate) async fn stage(
615658 spec : & RequiredHostSpec < ' _ > ,
616659 prog : ProgressWriter ,
617660) -> 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+
618675 let ostree = sysroot. get_ostree ( ) ?;
619676 let mut subtask = SubTaskStep {
620677 subtask : "merging" . into ( ) ,
@@ -773,19 +830,26 @@ pub(crate) async fn rollback(sysroot: &Storage) -> Result<()> {
773830 let rollback_image = rollback_status
774831 . query_image ( repo) ?
775832 . 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+ ) ;
789853 // SAFETY: If there's a rollback status, then there's a deployment
790854 let rollback_deployment = deployments. rollback . expect ( "rollback deployment" ) ;
791855 let new_deployments = if reverting {
@@ -833,6 +897,18 @@ fn find_newest_deployment_name(deploysdir: &Dir) -> Result<String> {
833897
834898// Implementation of `bootc switch --in-place`
835899pub ( 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+
836912 // First, just create the new origin file
837913 let origin = origin_from_imageref ( imgref) ?;
838914 let serialized_origin = origin. to_data ( ) ;
0 commit comments