Skip to main content

Posts

log4j - How to write log to multiple log files using log4j.properties

In Java applications some times you may need to write your log messages to specific log files with its own specific log properties. If you are using log4j internally then first step that you need to do is to have a proper log4j.properties file. Below example shows 2 log4j appenders which write to 2 different log files, one is a debug log and another one is a reports log. Debug log file can have all log messages and reports log can have log messages specific to reporting on say splunk monitoring. # Root logger option log4j.rootLogger=ALL,STDOUT,debugLog log4j.logger.reportsLogger=INFO,reportsLog log4j.additivity.reportsLogger=false     log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout log4j.appender.STDOUT.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %C:%L - %m%n     # Direct log messages to a log file log4j.appender.debugLog=org.apache.log4j.RollingFileAppen...

AWS Certification Study - VPC questions Part 2

1. You have a EC2 instance in your VPC with IPV4 addresses and you need to initiate outbound connections to the internet but prevent unsolicited inbound connections from the internet. What would you use?     a) VGW        b) Egress-Only Internet Gateways        c) EC2 instance with Elastic IP        d) NAT device ----------------------------------------------------------------------------------------------------------------------- 2. connections to the internet but prevent unsolicited inbound connections from the internet. What would you use?    a. NAT device    b. VGW    c. Egress-Only Internet Gateways    d. EC2 instance with Elastic IP ------------------------------------------------------------------------------------------------------------------------ 3. You have a Site-to-Site VPN connection consists of a virtual private ga...