Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jessieqliu
Copy link
Contributor

@jessieqliu jessieqliu commented Aug 9, 2024

Replaces our existing logging (with the "log" package) with a custom logging library that wraps (1) the Cloud Logging library (for logging to Cloud Logs) and (2) slog (for logging to the serial console). Using the Cloud Logging library allows for structured payloads and properly displayed severity (ex. ERROR logs) in the logging UI.

Note this does NOT include logging redirection from the workload - that is still sent via StdOut (in the case of Cloud Logging).

Examples

Cloud Logs
Screenshot 2024-10-11 3 05 42 PM
image

Serial Logs
Screenshot 2024-10-11 3 05 17 PM

Breaking Changes

  • Changes *log.Logger type to logging.Logger in agent.CreateAttestationAgent(), agent.fetchContainerimageSignatures(), ContainerRunner.logger, runner.NewRunner(), spec.GetLaunchSpec(), spec.fetchExperiments(), and teeserver.New()

@jessieqliu
Copy link
Contributor Author

/gcbrun

4 similar comments
@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu jessieqliu changed the title Testing migration to slog Use slog for logging Aug 15, 2024
@jessieqliu jessieqliu requested a review from jkl73 August 15, 2024 23:53
@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

5 similar comments
@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

if err != nil {
return fmt.Errorf("failed to convert %v into uint64, got: %v", devShmSizeKey, val)
}
s.DevShmSize = int64(size)

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types

Incorrect conversion of an unsigned 64-bit integer from [strconv.ParseUint](1) to a lower bit size type int64 without an upper bound check.
@jessieqliu
Copy link
Contributor Author

/gcbrun

4 similar comments
@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu jessieqliu changed the title Use slog for logging Add proper cloud logging Sep 26, 2024
@jessieqliu
Copy link
Contributor Author

/gcbrun

2 similar comments
@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu jessieqliu changed the title Add proper cloud logging Log with the cloud logging library Oct 1, 2024
@jessieqliu jessieqliu requested a review from alexmwu October 1, 2024 20:43
@jessieqliu
Copy link
Contributor Author

/gcbrun

Copy link
Contributor

@jkl73 jkl73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly nits, feel free to submit

@jessieqliu
Copy link
Contributor Author

/gcbrun

@jessieqliu jessieqliu merged commit c891518 into main Oct 23, 2024
@jessieqliu jessieqliu deleted the logging branch October 23, 2024 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants