@@ -98,22 +98,17 @@ pub(crate) fn check_bootc_label(config: &ostree_ext::oci_spec::image::ImageConfi
9898 {
9999 match label. as_str ( ) {
100100 crate :: metadata:: COMPAT_LABEL_V1 => { }
101- o => crate :: journal:: journal_print (
102- libsystemd:: logging:: Priority :: Warning ,
103- & format ! (
101+ o => {
102+ tracing:: warn!(
104103 "notice: Unknown {} value {}" ,
105- crate :: metadata:: BOOTC_COMPAT_LABEL ,
106- o
107- ) ,
108- ) ,
104+ crate :: metadata:: BOOTC_COMPAT_LABEL , o
105+ ) ;
106+ }
109107 }
110108 } 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- ) ,
109+ tracing:: warn!(
110+ "notice: Image is missing label: {}" ,
111+ crate :: metadata:: BOOTC_COMPAT_LABEL
117112 )
118113 }
119114}
@@ -429,11 +424,24 @@ pub(crate) async fn pull_from_prepared(
429424 let imgref_canonicalized = imgref. clone ( ) . canonicalize ( ) ?;
430425 tracing:: debug!( "Canonicalized image reference: {imgref_canonicalized:#}" ) ;
431426
427+ // Log successful import completion
428+ const IMPORT_COMPLETE_JOURNAL_ID : & str = "4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8" ;
429+
430+ tracing:: info!(
431+ message_id = IMPORT_COMPLETE_JOURNAL_ID ,
432+ bootc. image. reference = & imgref. image,
433+ bootc. image. transport = & imgref. transport,
434+ bootc. manifest_digest = import. manifest_digest. as_ref( ) ,
435+ bootc. ostree_commit = & import. merge_commit,
436+ "Successfully imported image: {}" ,
437+ imgref
438+ ) ;
439+
432440 if let Some ( msg) =
433441 ostree_container:: store:: image_filtered_content_warning ( & import. filtered_files )
434442 . context ( "Image content warning" ) ?
435443 {
436- crate :: journal :: journal_print ( libsystemd :: logging :: Priority :: Notice , & msg) ;
444+ tracing :: info! ( "{}" , msg) ;
437445 }
438446 Ok ( Box :: new ( ( * import) . into ( ) ) )
439447}
@@ -447,8 +455,30 @@ pub(crate) async fn pull(
447455 prog : ProgressWriter ,
448456) -> Result < Box < ImageState > > {
449457 match prepare_for_pull ( repo, imgref, target_imgref) . await ? {
450- PreparedPullResult :: AlreadyPresent ( existing) => Ok ( existing) ,
458+ PreparedPullResult :: AlreadyPresent ( existing) => {
459+ // Log that the image was already present (Debug level since it's not actionable)
460+ const IMAGE_ALREADY_PRESENT_ID : & str = "5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9" ;
461+ tracing:: debug!(
462+ message_id = IMAGE_ALREADY_PRESENT_ID ,
463+ bootc. image. reference = & imgref. image,
464+ bootc. image. transport = & imgref. transport,
465+ bootc. status = "already_present" ,
466+ "Image already present: {}" ,
467+ imgref
468+ ) ;
469+ Ok ( existing)
470+ }
451471 PreparedPullResult :: Ready ( prepared_image_meta) => {
472+ // Log that we're pulling a new image
473+ const PULLING_NEW_IMAGE_ID : & str = "6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0" ;
474+ tracing:: info!(
475+ message_id = PULLING_NEW_IMAGE_ID ,
476+ bootc. image. reference = & imgref. image,
477+ bootc. image. transport = & imgref. transport,
478+ bootc. status = "pulling_new" ,
479+ "Pulling new image: {}" ,
480+ imgref
481+ ) ;
452482 Ok ( pull_from_prepared ( imgref, quiet, prog, * prepared_image_meta) . await ?)
453483 }
454484 }
@@ -466,6 +496,14 @@ pub(crate) async fn wipe_ostree(sysroot: Sysroot) -> Result<()> {
466496}
467497
468498pub ( crate ) async fn cleanup ( sysroot : & Storage ) -> Result < ( ) > {
499+ // Log the cleanup operation to systemd journal
500+ const CLEANUP_JOURNAL_ID : & str = "2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6" ;
501+
502+ tracing:: info!(
503+ message_id = CLEANUP_JOURNAL_ID ,
504+ "Starting cleanup of old images and deployments"
505+ ) ;
506+
469507 let bound_prune = prune_container_store ( sysroot) ;
470508
471509 // We create clones (just atomic reference bumps) here to move to the thread.
@@ -615,6 +653,20 @@ pub(crate) async fn stage(
615653 spec : & RequiredHostSpec < ' _ > ,
616654 prog : ProgressWriter ,
617655) -> Result < ( ) > {
656+ // Log the staging operation to systemd journal with comprehensive upgrade information
657+ const STAGE_JOURNAL_ID : & str = "8f7a2b1c3d4e5f6a7b8c9d0e1f2a3b4c" ;
658+
659+ tracing:: info!(
660+ message_id = STAGE_JOURNAL_ID ,
661+ bootc. image. reference = & spec. image. image,
662+ bootc. image. transport = & spec. image. transport,
663+ bootc. manifest_digest = image. manifest_digest. as_ref( ) ,
664+ bootc. stateroot = stateroot,
665+ "Staging image for deployment: {} (digest: {})" ,
666+ spec. image,
667+ image. manifest_digest
668+ ) ;
669+
618670 let ostree = sysroot. get_ostree ( ) ?;
619671 let mut subtask = SubTaskStep {
620672 subtask : "merging" . into ( ) ,
@@ -773,19 +825,26 @@ pub(crate) async fn rollback(sysroot: &Storage) -> Result<()> {
773825 let rollback_image = rollback_status
774826 . query_image ( repo) ?
775827 . 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- ) ?;
828+
829+ // Get current booted image for comparison
830+ let current_image = host
831+ . status
832+ . booted
833+ . as_ref ( )
834+ . and_then ( |b| b. query_image ( repo) . ok ( ) ?) ;
835+
836+ tracing:: info!(
837+ message_id = ROLLBACK_JOURNAL_ID ,
838+ bootc. manifest_digest = rollback_image. manifest_digest. as_ref( ) ,
839+ bootc. ostree_commit = & rollback_image. merge_commit,
840+ bootc. rollback_type = if reverting { "revert" } else { "rollback" } ,
841+ bootc. current_manifest_digest = current_image
842+ . as_ref( )
843+ . map( |i| i. manifest_digest. as_ref( ) )
844+ . unwrap_or( "none" ) ,
845+ "Rolling back to image: {}" ,
846+ rollback_image. manifest_digest
847+ ) ;
789848 // SAFETY: If there's a rollback status, then there's a deployment
790849 let rollback_deployment = deployments. rollback . expect ( "rollback deployment" ) ;
791850 let new_deployments = if reverting {
@@ -833,6 +892,18 @@ fn find_newest_deployment_name(deploysdir: &Dir) -> Result<String> {
833892
834893// Implementation of `bootc switch --in-place`
835894pub ( crate ) fn switch_origin_inplace ( root : & Dir , imgref : & ImageReference ) -> Result < String > {
895+ // Log the in-place switch operation to systemd journal
896+ const SWITCH_INPLACE_JOURNAL_ID : & str = "3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7" ;
897+
898+ tracing:: info!(
899+ message_id = SWITCH_INPLACE_JOURNAL_ID ,
900+ bootc. image. reference = & imgref. image,
901+ bootc. image. transport = & imgref. transport,
902+ bootc. switch_type = "in_place" ,
903+ "Performing in-place switch to image: {}" ,
904+ imgref
905+ ) ;
906+
836907 // First, just create the new origin file
837908 let origin = origin_from_imageref ( imgref) ?;
838909 let serialized_origin = origin. to_data ( ) ;
0 commit comments