You are on page 1of 24

Professional

JavaScript Error-Logging
for Oracle APEX
Kai Donato
Jun 28, 2017 | Kscope17
Facts & Figures

Headquarter
Ratingen 180
(North Rhine – Westphalia) Employees
Independent Technology House
with Cross-Industry Expertise

Privately- Oracle
28 Mio. Euro Founded
Owned Platinum
Revenue 1994
Corporation Partner

Top Company Branches


for Trainees & Dortmund, Cologne,
Students Frankfurt am Main

3
About me
KaiDonato
• Employee at MT AG in Ratingen since January 2014

• Senior Consultant for APEX Development

• DOAG-Initiator - HTML5 and JavaScript

• More than 10 Years expertise in Web-Development

• Systems Integrations Specialist @_KaiDonato


UNIX-Server and Networkadministration

4
Professional JavaScript
Error-Logging for
Oracle APEX
Logging with Oracle APEX

Usually you used to see all kinds of errors logged into the
database:

• APEX internal errors

• Erroneous PLSQL-Routines

• Any kind of thrown Exceptions

...But what about JavaScript?


Doing it the
basic/usual way...
... Let the user describe
what happened in the UI.
„Umm ... I just clicked ... like

! 3 times on this button ...


and it didn‘t do what I
expected...“
" „It simply didn‘t do
anything.“
HTML and JavaScript sent

Not happening!
...yet
Why logging JavaScript-Errors?

• JavaScript is used in nearly everywhere in APEX


... errors can happen even if you didn‘t write that much JavaScript by
yourself

• JavaScript-Errors are happening on the client-side


... and they stay there if we don‘t do anything about it

• JavaScript might be used just for aesthetic reasons but also for
critical parts of the application
JS-Logger
JS-Logger
🚀
Console-Object
• The console-object contains functions we
can use
• console.log/warn/error will be
thrown automatically - and if you want -
manually
• By overwriting these functions we can
change/extend their behaviour
JS-Logger

• All JavaScript-Errors/Logs will be inserted into the database or sent via


REST-Call to a remote destination of your choice

• JS-Logger consists of multiple components:


• Dynamic Action Plugin
• Database Objects (optional)
• APEX-Application for analyzing errors (optional)

• Multiple additional libraries were integrated to enrich the error-logs with


further helpful details about the environment
• Stacktrace.js
• Platform.js
JS-Logger

• The following metrics will be used to track errors:


• Platform

• Error-message

• Stacktrace

• Workflow (which are the recently visited pages?)

• Current APEX-Page

• Application Version
How to implement JS-Logger?
DEMO
Thank You! Kai Donato
Telefon: +49 2102 30961 – 0
kai.donato@mt-ag.com
@_KaiDonato

You might also like