FUNDAMENTALS TEST 2025
(QUESTIONS WITH 100% CORRECT
ANSWERS)
Logging - ANSWERProcess of recording application actions and state to a secondary
interface
used for:
Application maintenance and troubleshooting
Creating statistics relating to application usage
Auditing by capturing significant events
Typical events to log - ANSWERSuccess / Failure - a transaction or action has
succeeded or failed
Recovery - a system went down or connection failed, retried, and recovered
Identification - any large functional areas such as integration, rating, reinsurance, and
rules
Logger - ANSWERlogical file name and encapsulates logging category
Has category and level, sends content to Appender
Group log messages so they have consistent structure and format
Defined in logging configuration file or created directly in Gosu class
inherit properties from parent logger but can overwrite them
Appender - ANSWERis an output point (destination) for a logger such as app console or
specific logging file
Layout - ANSWERdefines the log entry formatting instructions
- Each appender can have its own layout format
Logging components defined in logging config file under - ANSWERconfiguration -->
config --> logging
, There are 2 ways to initialize a logger in Gosu - ANSWERIntegration:
PLLoggerCategory.INTEGRATIONPlugin: PLLoggerCategory.PLUGIN
Use sub-level of existing logging category to maintain structure.
Example: PLUGIN.MotorVehicleRecord
static var _motorVehiclePluginLogger =
LoggerFactory.getLogger(PLLoggerCategory.PLUGIN."MotorVehicleRecord")
Logging format - ANSWERstandard format to simplify analysis of large logs
Writing structured logs using appenders makes it easier to read, analyse and process
logs
Log4j2's DailyRollingFileAppender logs messages to a file and rolls them over into
backups at user-specified time intervals
Conversion patterns specify output format for the message
Format all log messages - ANSWERApply standard form to logged messages useful,
especially analysing large logs
- Reference class and function signature
- Use data identifiers with key value pairs
Guarded Logging - ANSWERLogging messages with string concatenations or calls to
methods that perform expensive computations can be costly and affect application
performance
Check log level enabled before logging costly messages
Parameterised logging - ANSWERLogging string literal, you do not have to check
logging levels
Typically used with the DEBUG levelFormat is - if (_logger.DebugEnabled) { <log
statement content>}
Not required for parameterized expressions lacking expensive operations, as in:var
hello = "Hello"var world = "world"_logger.debug("{}, {}!", hello, world)
#
When replacement parameter involves expensive method call, necessary to guard log
statement