Repository: quarkusio/quarkus
Issue: Runtime exception on building application jar

### Describe the bug

When I try to build application jar the following exception occures:

`ERROR]         [error]: Build step io.quarkus.deployment.logging.LoggingResourceProcessor#setupLoggingRuntimeInit threw an exception: java.lang.RuntimeException: You cannot invoke getValue() directly on an object returned from the 
bytecode recorder, you can only pass it back into the recorder as a parameter
[ERROR]         at io.quarkus.deployment.recording.BytecodeRecorderImpl$3.invoke(BytecodeRecorderImpl.java:444)
[ERROR]         at io.quarkus.deployment.recording.BytecodeRecorderImpl$$ReturnValueProxy22.getValue(Unknown Source)
[ERROR]         at io.quarkus.runtime.logging.LoggingSetupRecorder.configureFileHandler(LoggingSetupRecorder.java:500)
[ERROR]         at io.quarkus.runtime.logging.LoggingSetupRecorder.createNamedHandlers(LoggingSetupRecorder.java:333)
[ERROR]         at io.quarkus.runtime.logging.LoggingSetupRecorder.initializeBuildTimeLogging(LoggingSetupRecorder.java:261)
[ERROR]         at io.quarkus.deployment.logging.LoggingResourceProcessor.setupLoggingRuntimeInit(LoggingResourceProcessor.java:225)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:944)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:829)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException`

**Possible root cause**
Direct use of possibleFileFormatters in io.quarkus.runtime.logging.LoggingSetupRecorder::initializeBuildTimeLogging. 
Does logging to file make sense at build time? 

### Expected behavior

Quarkus jar is build.

### Actual behavior

Error occurs: Build step io.quarkus.deployment.logging.LoggingResourceProcessor#setupLoggingRuntimeInit threw an exception: java.lang.RuntimeException: You cannot invoke getValue() directly on an object returned from the 
bytecode recorder, you can only pass it back into the recorder as a parameter

### How to Reproduce?

a) Checkout https://github.com/quarkusio/quarkus-quickstarts/tree/main/getting-started
b) add the following to application.properties
quarkus.log.handler.file."aaa".enable=true
quarkus.log.handler.file."aaar".path=./logs/aaa.log
quarkus.log.handler.file."aaa".level=INFO
c) add depdencency to io.quarkus:quarkus-logging-json in pom.xml
d) run mvnw package

### Output of `uname -a` or `ver`

Microsoft Windows [Version 10.0.19044.1766]

### Output of `java -version`

openjdk 11.0.15 2022-04-19

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

2.10.x

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)

### Additional information

_No response_

Changed files:
core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java
core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java

diff --git a/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java
index 0045e8e8cba..7501e18b087 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java
@@ -237,7 +237,7 @@ LoggingSetupBuildItem setupLoggingRuntimeInit(RecorderContext context, LoggingSe
             ConsoleRuntimeConfig crc = new ConsoleRuntimeConfig();
             ConfigInstantiator.handleObject(crc);
             LoggingSetupRecorder.initializeBuildTimeLogging(logConfig, buildLog, categoryMinLevelDefaults.content,
-                    crc, possibleFileFormatters, launchModeBuildItem.getLaunchMode());
+                    crc, launchModeBuildItem.getLaunchMode());
             ((QuarkusClassLoader) Thread.currentThread().getContextClassLoader()).addCloseTask(new Runnable() {
                 @Override
                 public void run() {
diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java
index aac631b5388..4b0ec8741df 100644
--- a/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java
+++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java
@@ -231,9 +231,13 @@ public void accept(String categoryName, CategoryConfig config) {
         InitialConfigurator.DELAYED_HANDLER.setHandlers(handlers.toArray(EmbeddedConfigurator.NO_HANDLERS));
     }
 
+    /**
+     * WARNING: this method is part of the recorder but is actually called statically at build time.
+     * You may not push RuntimeValue's to it.
+     */
     public static void initializeBuildTimeLogging(LogConfig config, LogBuildTimeConfig buildConfig,
             Map<String, InheritableLevel> categoryDefaultMinLevels,
-            ConsoleRuntimeConfig consoleConfig, List<RuntimeValue<Optional<Formatter>>> possibleFileFormatters,
+            ConsoleRuntimeConfig consoleConfig,
             LaunchMode launchMode) {
 
         final Map<String, CategoryConfig> categories = config.categories;
@@ -263,7 +267,7 @@ public static void initializeBuildTimeLogging(LogConfig config, LogBuildTimeConf
 
         Map<String, Handler> namedHandlers = createNamedHandlers(config, consoleConfig, Collections.emptyList(),
                 Collections.emptyList(),
-                possibleFileFormatters, errorManager, logCleanupFilter, launchMode);
+                Collections.emptyList(), errorManager, logCleanupFilter, launchMode);
 
         for (Map.Entry<String, CategoryConfig> entry : categories.entrySet()) {
             final String categoryName = entry.getKey();