I am trying to configure my multi-stage application to also output console messages (log) to a file.
So here is my main class:
public class Main extends Application {
private Stage stage;
private User loggedUser;
...
public static void main(String[] args) throws IOException {
Application.launch(Main.class, (java.lang
.String[])null);
}
@Override
public void start(Stage primaryStage) throws IOException {
try {
stage = primaryStage;
stage.setTitle("FXML Login Sample");
gotoLogin();
primaryStage.show();
} catch (Exception ex) {
Logger.getLogger(Main.class.getName()).log(Level.INFO, null, ex);
}
}
...
private void gotoProfile() {
try {
FXMLDocumentController fxmlDocument = (FXMLDocumentController) replaceSceneContent("FXMLDocument.fxml");
fxmlDocument.setApp(this);
} catch (Exception ex) {
Logger.getLogger(Main.class.getName()).log(Level.INFO, null, ex);
}
}
private void gotoLogin() {
try {
LoginController login = (LoginController) replaceSceneContent("login.fxml");
login.setApp(this);
} catch (Exception ex) {
Logger.getLogger(Main.class.getName()).log(Level.INFO, null, ex);
}
}
How could i write console's output in a file also? Should i configure a second logger of just use the existing one and append its content to a file?