Welcome to this session on Logging in OutSystems. In this session, we'll
discuss what is logged and since errors have to be logged we'll discuss the
anatomy of an error detail we'll also look at how we can configure module
logging and take a deep dive into how logging works in out systems in general
so let's go ahead and get started what is logged as you can see quite a
few things are logged inside of out systems if we try to find these inside
of service center if we go to the monitoring tab
we can see that the first set of things that are logged are errors and then
general types of audit logs web requests and mobile requests integrations which
would include web service and restful service requests extensions and many
different types of asynchronous behavior like timers SMS emails and processes and
last but not least mobile app generation is also logged so that we know if there
are any problems when mobile apps are being generated here we can see the user
interface to be able to view something like the error logs we can get a list of
the most recent logs and then there's also a number of different ways to
filter those errors so that we can try to find the ones we need as quickly as
possible now by default out systems logs all application errors so anytime a user
may encounter an error message it is going to be logged and captured inside
the database so though we'll know exactly what affected their overall
experience when we get some sort of error the error and other log messages
can be inspected and service center as we just saw when we look at the error
detail what we'll find is that there's a lot of information that we can find out
about the air we'll know when the error was logged which application module it
occurred in and if the user had to be registered and
in the user ID of the user that was using that module will then get the
actual error message and any extra information about the environment that
might be useful to this particular error and below all of this we can see that
we'll actually get the stack trace of the call of the code so when we begin
looking at the stack trace we can find a lot of different useful information if
we dig deep enough we may be able to find where in the code the error
actually occurred like the module the screen or the action
and although these are out systems specific things when we dig inside of
the code what we can find is we begin to look and see that there are certain
places where os MDB which was the module was calling an extended action called
create person movie roll and this told us the entity action that was being
called and then after that was called that was actually going to be part of
the main flow and it was in a screen and it was part of an overall save action so
we can get from the screen to the action and to the entity action that's trying
to be called within this set of actions and we know the module in which all of
this occurs so that we can try to go find and debug these problems as quickly
as possible now how do we set up the different types of logging
configurations well by default the server has a number of different
settings that will be applied to all modules and again all errors are always
going to be captured unless we turn that off but what we can do is go into our
Factory and go down to the E space or module level and here we can see that we
can turn auditing on and off so we can take the general log messages that can
be added to through an API and through different methods by the developer we
can turn this on and off and control it we can also turn on
and off activity logging so the logging of the screens the extensions the
integrations that we talked about so those don't have to be logged every time
they are called unless we want them to so coming down to
the module and going to the end when we're on the operations tab then we have
access to things like auditing and activity logging to go ahead and control
the level of logging on each module now the OutSystems platform was designed for
performance and scalability and we expect heavy loads in enterprise
scenarios so this means that the logging capabilities have to have the least
impact on the overall performance of the application as possible so inside of out
systems log information is stored in a set of ten database tables for each type
of log that exists only one of these tables is used at any given time and an
automatic procedure changes the active table weekly so this means that every so
often the active table returns to a previously used table and if this occurs
then the table is cleared and those old weekly logs would be lost now the number
of tables used in the rotation is corresponding to the number of weeks you
wish to store the logs for by default the value is set to four so although we
have ten tables allocated for this by default only four of them will be used
now along with these tables OutSystems also creates two table views one that
points to the active table and one that points to the one that was used the week
before these views are also updated in the rotation as the weeks change service
center can display the log information from only those two views so that means
if you want something from weeks that are older than that you may have to
query the database directly to get those older logs now in order to achieve the
goal of minimum impact on the applications
that are running inside of out systems we have created and are using
asynchronous logging mechanisms and they work in the following way the
applications including even applications like service center and lifetime are
going to send messages to a logging system that has a message queue for
dotnet and iis this would be something like a Microsoft
message queue then the OutSystems platform log service will constantly be
pulling the message queue to look for new messages when it finds sets of new
messages are available those logs can then be written to the database and
those rights can occur using bulk methods so that we get the best
performance possible so we covered a lot of different information about logging
and that's it for this session on logging and out systems thanks for
watching and have a great day