So in the previous video,
we kind of displayed some things with the logs here.
I mean, you can see what's going on.
Here's a bunch of logs that we see on the screen,
but this isn't super granular.
I mean, I can see kind of like what the process name was.
Maybe that's the log level
and this is the actual log name.
Then here's the description,
but I don't get a huge,
I don't get the warm fuzzies from this.
I can't tell what happened in what order.
I can't tell, you know, when did this really happen? WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
I can't tell, you know, when did this really happen?
If I'm trying to analyze historically the logs here,
this doesn't really help me at all.
So what we can do to change what is actually logged,
what is actually written to the screen or to a file,
we need to use the service timestamps command.
Now, when you press question mark here,
we can see, are we adjusting this for logs
or are we adjusting this for a debug session?
You got to fix that first.
Now we're ultimately going to do both here in this example,
but since we're talking about logging and syslog, WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
but since we're talking about logging and syslog,
I'm going to adjust this for the log.
Give it a question mark.
And now what are we talking about?
Well, what we're going to set is basically,
I want to see date time details.
Uptime doesn't really help me
because when I see this right here, logging to the terminal,
the uptime would just say,
how long has the system been alive?
That's really only useful
if I'm having some sort of reboot problem
where the machine keeps going down and rebooting.
At which point I would want to look at the logs WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
At which point I would want to look at the logs
and see what was happening
right before it was shutting down and rebooting.
So I would look, you know, I would find, you know,
what's the one with the lowest uptime,
then look at the message before that.
But right now I'm just trying to look at what's going on
exactly when something goes on.
So I'll go into date time.
So now we're looking at what is the date time settings
for syslog messages.
And here, when I press question mark,
this is where we can turn these options on.
I want to see my local time. WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
I want to see my local time.
I want to see it in milliseconds.
I want to see what time zone we've got it configured.
And I want to see year.
So we turn all of these on.
Like so, you just type them in,
show time zone and year, press enter,
and that's configured.
Now, when I want to do this for the debug messages too,
I can issue the same command,
but instead of log, I set debug.
Now watch this, when I do end,
ah, there's full date, WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
ah, there's full date,
full time with milliseconds and UTC time zone.
Then I see this as a system message,
probably log level five,
configuration I is the log code.
And then the actual description of the log message
right there has now been brought to life.
Now, again, when I do show logging right here,
let's do show logging.
We're seeing the log levels for console
and it's at debugging currently. WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
and it's at debugging currently.
We see the log levels for monitor for VTY sessions.
That's in debugging currently.
And then we see the log levels for buffer,
which is when we're going to export it somewhere else.
That is currently set to debugging.
Let's say that's going to be a little too explicit
for our VTY sessions or SSH sessions.
And we want to run, you know, monitor logging.
Maybe it's something at a lower level, like level three.
So what I can do here is I can go back
into configuration mode, config T, WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
into configuration mode, config T,
and I will say logging for monitor.
Then you hit question mark here.
And this is where you set the log level.
So when I want to set this to level three, which is errors,
I can either type errors here,
or if I know the log level,
I can just type the number right there.
So I'll type three.
And now we've configured VTY sessions
to only log for level three.
Now let's test this out.
I'm going to go into line VTY 04. WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
I'm going to go into line VTY 04.
And from here, I'm going to say no login is required.
Let's give it privilege level 15,
just to give it a test out.
This is a lab environment, doesn't matter.
And from here, if I do show logging,
we can see I've got now set to error level
instead of debugging.
And if I do show IP interface brief,
I should be able to SSH in to something
like this loopback interface here, WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
like this loopback interface here,
or telnet in, I should say.
So what I'll do here is I'll press enter to get started.
And I'll do telnet 1111.
And it's open.
And we can see now I'm on R1.
Now, like I said, you're not going to see log messages here
until you tell it, I want to see log messages
on this telnet session.
So what do we type in to actually start seeing
a lot of the log messages?
We need to say terminal monitor, like this. WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
We need to say terminal monitor, like this.
When I press this, now that's going to enable me
to see logging messages here on the table.
So if I wanted to do something,
let's go into configuration mode.
And let's go ahead and set this back to be terminal.
Oh, wait, wait, wait, wrong button.
We need to do logging.
Let's set it back to high level, like debug.
Logging for the monitor session of seven.
Let's exit out of this configuration mode.
Now I get the log message to the terminal
exactly like I expected. WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
exactly like I expected.
We can also do something like turning on a debug.
So look at these OSPF adjacencies coming up
like this right there.
So that tells me right there,
now I'm getting these log messages to the terminal
because I've turned the logging on.
If we were to do something like turn on debugging as well,
we would now see the debug messages
coming up on the screen too.
Whereas before on R1, when we were on a console line,
we wouldn't be able to see it.
So anyways, long story short,
let's go ahead and exit out of this session here. WEBVTT X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000
let's go ahead and exit out of this session here.
Exit.
And now we're out back into R2.
So now we've seen how to adjust logging
and configurations for logging using Cisco iOS.