openshift / oc-mirror

Lifecycle manager for internet-disconnected OpenShift environments
Apache License 2.0
91 stars 82 forks source link

CLID-174: Use io.MultiWriter for the logger - logs to both stdout and… #940

Closed sherine-k closed 1 month ago

sherine-k commented 1 month ago

… working-dir/logs

Description

This enables oc-mirror to send logs both to the console output and to a file working-dir/logs/oc-mirror.log. Please note that the logs folder is cleared at each start of oc-mirror, so the file will contain the logs from a single execution (no append).

Fixes # CLID-174

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Run a mirror to disk and check the working-dir/logs/oc-mirror.log file.

Expected Outcome

oc-mirror.log file contains logs

openshift-ci-robot commented 1 month ago

@sherine-k: This pull request references CLID-174 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to [this](https://github.com/openshift/oc-mirror/pull/940): >… working-dir/logs > ># Description > >This enables oc-mirror to send logs both to the console output and to a file working-dir/logs/oc-mirror.log. >Please note that the logs folder is cleared at each start of oc-mirror, so the file will contain the logs from a single execution (no append). > >Fixes # [CLID-174](https://issues.redhat.com/browse/CLID-174) > >## Type of change > >Please delete options that are not relevant. > >- [ ] Bug fix (non-breaking change which fixes an issue) >- [x] New feature (non-breaking change which adds functionality) >- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) >- [ ] This change requires a documentation update > ># How Has This Been Tested? > >Run a mirror to disk and check the working-dir/logs/oc-mirror.log file. > >## Expected Outcome >oc-mirror.log file contains logs Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Foc-mirror). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sherine-k

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/oc-mirror/blob/main/OWNERS)~~ [sherine-k] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
sherine-k commented 1 month ago

/retest

openshift-ci[bot] commented 1 month ago

@sherine-k: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
aguidirh commented 1 month ago

/lgtm

openshift-bot commented 1 month ago

[ART PR BUILD NOTIFIER]

Distgit: oc-mirror-plugin This PR has been included in build oc-mirror-plugin-container-v4.18.0-202410211413.p0.g30b8c90.assembly.stream.el9. All builds following this will include this PR.