Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSC305 Lecture 15

CSC305 Lecture 15

Individual Software Design and Development
Loggers
(202511)

Avatar for Javier Gonzalez-Sanchez

Javier Gonzalez-Sanchez PRO

October 24, 2025
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.info o ffi ce: 14 -227

    CSC 305 Individual Software Design and Development Lecture 15. Logger
  2. Assignment 03 | Example 1 | Tab 1 5 Bo

    a rdP a nel M a in Controller M a in01.j a v a Take the population values and divide them into three groups by first finding the largest and smallest values, then calculating the range between them, and finally using that range to set two cut- off points.
  3. Assignment 03 | Example 1 | Tab 2 6 Painful

    Useless Controller Main BoardPanel * java files colors to be calculated; * not showing them here Add inheritance and local variables, but only for the other classes in this folder
  4. Assignment 03 | Example 1 | Tab 3 7 👷

    This space is empty for now
  5. SLF4J Logback • St a nds for Simple Logging F

    a c a de for J a v a • It provides a uni f ied interf a ce for logging oper a tions, a llowing developers to write logging code without binding their a pplic a tion to a speci f ic logging implement a tion. • We need to t a lk a bout the F a c a de P a ttern 12
  6. We want this 15 message 01 message 02 message 03

    message 04 message 05 trace() debug() info () warn () error() Logger 15
  7. Resources Folder • The resources folder in a M a

    ven project stores non-source-code f iles th a t your a pplic a tion needs, such a s con f igur a tion f iles, property f iles, im a ges, a nd other resources. • These f iles a re included in the f in a l build output a nd a v a il a ble on the cl a ssp a th a t runtime. 18
  8. src/main/resources/logback.xml • logb a ck.xml is a con f igur

    a tion f ile for SLF4J Logb a ck. • It de f ines how logging should be h a ndled, including log levels, a ppenders (where logs a re written), a nd log form a ts. • When your a pplic a tion st a rts, SLF4J Logb a ck a utom a tic a lly looks for this con f igur a tion f ile. 19
  9. ConsoleAppender 20 message 01 message 02 message 03 message 04

    message 05 trace() debug() info () warn () error() Logger 20 Appender
  10. ConsoleAppender 23 message 01 message 02 message 03 message 04

    message 05 trace() debug() info () warn () error() Logger 23 Appender
  11. Next 25 trace() debug() info () warn () error() message

    01 message 02 message 03 message 04 message 05 Logger Appender Appender
  12. Next 29 trace() debug() info () warn () error() message

    01 message 02 message 03 message 04 message 05 Logger Appender
  13. Cloud-Base Log Management • Cloud-b a sed log m a

    n a gement refers to the pr a ctice of collecting, storing, a n a lyzing, a nd m a n a ging log d a t a using cloud services. • This a ppro a ch lever a ges cloud computing to h a ndle the v a st a mounts of log d a t a 30
  14. SLF4J Logback | Add the dependency 36 Just for JSON

    Support https://github.com/CSC3100/Tool-Logging
  15. Full Solution 43 trace() debug() info () warn () error()

    message 01 message 02 message 03 message 04 message 05 Logger Appender Appender Appender
  16. Logstash Logback Encoder | POM.xml • Let’s use a nother

    libr a ry to t a ke a dv a nt a ge of extr a encoders • form a t Spring Boot logs in JSON form a t 45 https://github.com/CSC3100/Tool-Logging
  17. Lab

  18. 50

  19. CSC 305 Individual Software Design and Development Javier Gonzalez-Sanchez, Ph.D.

    [email protected] Fall 2025 Copyright. These slides can only be used as study material for the class CSC305 at Cal Poly. They cannot be distributed or used for another purpose.