Spring Boot logs not showing in kubectl logs

I’m running a Spring Boot app in Minikube v1.32.0. The minikube is running in WSL with the Docker driver, and my host machine is Windows 10. The app loads fine without any pod restarts. The issue is, that none of my logs are visible in the output of kubectl logs, only logs of the framework itself (which look valid):

When running the app on localhost, or simply in Docker, I can see all my logs, so this is clearly an issue specific to k8s. For example, here’s a snippet from my code. Neither slf4j nor System.out.println print anything:

package com.mathportal.gateway;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class GatewayApplication {

	private static final Logger logger = LoggerFactory.getLogger(GatewayApplication.class);

	public static void main(String[] args) {
		SpringApplication.run(GatewayApplication.class, args);

		logger.info("Not printing in k8s....");
        System.out.println("Not printing either....");
	}
}

EDIT:

After running minikube delete and then minikube start, issue was resolved (simply deleting deployments didn’t work). It seems that it was printing logs of the previous version of the app, a version that didn’t include my log statements. But still, this should not happen. Is there any way to solve it without having to delete minikube each time?