Skip to content

Commit

Permalink
Make agent and pantry use bunyan format for logs (#730)
Browse files Browse the repository at this point in the history
Update agent any pantry to use the `ConfigLogging::File` for logging
to be consistent with the rest of the control plane.
  • Loading branch information
leftwo authored May 11, 2023
1 parent 9f69dea commit f709f66
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 4 additions & 2 deletions agent/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![allow(clippy::needless_collect)]
use anyhow::{anyhow, bail, Result};
use clap::Parser;
use dropshot::{ConfigLogging, ConfigLoggingLevel};
use dropshot::{ConfigLogging, ConfigLoggingIfExists, ConfigLoggingLevel};
use slog::{error, info, o, warn, Logger};
use std::collections::HashSet;
use std::io::Write;
Expand Down Expand Up @@ -214,8 +214,10 @@ async fn main() -> Result<()> {
downstairs_prefix,
snapshot_prefix,
} => {
let log = ConfigLogging::StderrTerminal {
let log = ConfigLogging::File {
level: ConfigLoggingLevel::Info,
path: "/dev/stdout".into(),
if_exists: ConfigLoggingIfExists::Append,
}
.to_logger(PROG)?;

Expand Down
8 changes: 6 additions & 2 deletions downstairs/src/stats.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright 2021 Oxide Computer Company
use super::*;

use dropshot::{ConfigDropshot, ConfigLogging, ConfigLoggingLevel};
use dropshot::{
ConfigDropshot, ConfigLogging, ConfigLoggingIfExists, ConfigLoggingLevel,
};
use omicron_common::api::internal::nexus::ProducerEndpoint;
use oximeter::{
types::{Cumulative, Sample},
Expand Down Expand Up @@ -141,8 +143,10 @@ pub async fn ox_stats(
request_body_max_bytes: 2048,
tls: None,
};
let logging_config = ConfigLogging::StderrTerminal {
let logging_config = ConfigLogging::File {
level: ConfigLoggingLevel::Error,
path: "/dev/stdout".into(),
if_exists: ConfigLoggingIfExists::Append,
};

let server_info = ProducerEndpoint {
Expand Down
6 changes: 4 additions & 2 deletions pantry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::sync::Arc;

use anyhow::Result;
use dropshot::{ConfigLogging, ConfigLoggingLevel};
use dropshot::{ConfigLogging, ConfigLoggingIfExists, ConfigLoggingLevel};
use slog::{o, Logger};

pub const PROG: &str = "crucible-pantry";
Expand All @@ -12,8 +12,10 @@ pub mod pantry;
pub mod server;

pub async fn initialize_pantry() -> Result<(Logger, Arc<pantry::Pantry>)> {
let log = ConfigLogging::StderrTerminal {
let log = ConfigLogging::File {
level: ConfigLoggingLevel::Info,
path: "/dev/stdout".into(),
if_exists: ConfigLoggingIfExists::Append,
}
.to_logger(PROG)?;

Expand Down

0 comments on commit f709f66

Please sign in to comment.