Browse Source

feat: some files

master
QuentinN42 8 months ago
parent
commit
03e406bcf9
Signed by: number42 GPG Key ID: 2CD7D563712B3A50
  1. 4
      Dockerfile
  2. 15
      bin/main/Main.kt
  3. 26
      bin/main/log4j2.xml

4
Dockerfile

@ -11,4 +11,6 @@ ENV APP_NAME victim
COPY --from=build /usr/local/src/build/install/${APP_NAME}/bin/${APP_NAME} /usr/local/bin/app
COPY --from=build /usr/local/src/build/install/${APP_NAME}/lib/ /usr/local/lib/
ENTRYPOINT [ "/usr/local/bin/app" ]
RUN echo '#!/bin/sh\n/usr/local/bin/app $@ && tail -f /dev/null' > /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]

15
bin/main/Main.kt

@ -0,0 +1,15 @@
import org.apache.logging.log4j.Logger
import org.apache.logging.log4j.LogManager
// Get the logger to use for output
val logger: Logger = LogManager.getLogger()
fun work(input: String)
{
logger.info("Working on {}", input)
}
fun main(args: Array<String>) {
args.forEach{work(it)}
}

26
bin/main/log4j2.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Configuration file for Log4J2
It directs all logs to the console at a level of TRACE. Internal Log4J
messages are printed at the WARN level though.
-->
<Configuration status="WARN">
<!-- Define an appender to the Console -->
<!-- Mostly use the default pattern, but get rid of the thread -->
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<!-- Define the root logger at level TRACE -->
<!-- Print all output to the console -->
<Loggers>
<Root level="TRACE">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
Loading…
Cancel
Save