Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mon: Filter `log last` output by severity and channel #15924

Merged
merged 4 commits into from Jun 30, 2017

Conversation

Projects
None yet
3 participants
@jcsp
Copy link
Contributor

jcsp commented Jun 26, 2017

No description provided.

John Spray added some commits Jun 25, 2017

John Spray
mon: limit `log last` to INFO by default + allow setting
The syntax is crude because we only have positional arguments,
but anyone who wants anything different can probably handle
saying how many lines they want.

INFO is the same default setting as "ceph -w".

Signed-off-by: John Spray <john.spray@redhat.com>
John Spray
mon: filter `log last` by channel, default to `cluster`
Caller can pass "*" to get old behaviour (audit and
cluster mixed together).

The audit log messages are visually messy and usually
not of interest to someone trying to see what their
cluster is doing.

Signed-off-by: John Spray <john.spray@redhat.com>

@jcsp jcsp added the mon label Jun 26, 2017

@jcsp jcsp requested a review from liewegas Jun 26, 2017

std::string level_str;
clog_type level;
if (cmd_getval(g_ceph_context, cmdmap, "level", level_str)) {
if (level_str == "debug") {

This comment has been minimized.

Copy link
@liewegas

liewegas Jun 26, 2017

Member

https://github.com/ceph/ceph/blob/master/src/librados/RadosClient.cc#L946

maybe a helper in common/LogEntry.h.. one that will take 'err' or 'error', etc?

@liewegas
Copy link
Member

liewegas left a comment

That helper would be nice (even as a followup), but otherwise this LGTM!

@liewegas liewegas added the needs-qa label Jun 27, 2017

@liewegas

This comment has been minimized.

Copy link
Member

liewegas commented Jun 27, 2017

retest this please

John Spray
mon: helper function for string to log level
Signed-off-by: John Spray <john.spray@redhat.com>
@jcsp

This comment has been minimized.

Copy link
Contributor Author

jcsp commented Jun 27, 2017

Updated with helper fn

@liewegas

This comment has been minimized.

Copy link
Member

liewegas commented Jun 27, 2017

retest this please

// We'll apply this twice, once while counting out lines
// and once while outputting them.
auto match = [level, channel](const LogEntry &entry) {
return entry.prio >= level && (entry.channel == channel || channel == "*");

This comment has been minimized.

Copy link
@tchaikov

tchaikov Jun 29, 2017

Contributor

this breaks the test of https://github.com/ceph/ceph/blob/master/qa/workunits/cephtool/test.sh#L709-L711. see http://pulpito.ceph.com/kchai-2017-06-28_07:28:49-rados-wip-kefu-testing-distro-basic-smithi/1337521/

probably, we should have

diff --git a/src/mon/LogMonitor.cc b/src/mon/LogMonitor.cc
index 319196b6c5..0d0fd63dbc 100644
--- a/src/mon/LogMonitor.cc
+++ b/src/mon/LogMonitor.cc
@@ -500,6 +500,7 @@ bool LogMonitor::prepare_command(MonOpRequestRef op)
     le.seq = 0;
     le.prio = CLOG_INFO;
     le.msg = str_join(logtext, " ");
+    le.channel = CLOG_CHANNEL_DEFAULT;
     pending_summary.add(le);
     pending_summary.prune(g_conf->mon_log_max_summary);
     pending_log.insert(pair<utime_t,LogEntry>(le.stamp, le));

also?

This comment has been minimized.

Copy link
@jcsp

jcsp Jun 29, 2017

Author Contributor

I agree, I've pushed an update.

John Spray
mon: make `log` command send messages to default channel
...rather than leaving channel blank.  This means that
people watching the main "cluster" channel will see
the log messages sent using `log`.

Signed-off-by: John Spray <john.spray@redhat.com>

@liewegas liewegas added the needs-qa label Jun 29, 2017

@liewegas liewegas merged commit d04f5a1 into ceph:master Jun 30, 2017

4 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
default Build finished.
Details
make check make check succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.