Skip to content

Commit

Permalink
[BISERVER-15169] Adding debug logging to backup and restore process
Browse files Browse the repository at this point in the history
  • Loading branch information
rmansoor committed Dec 19, 2024
1 parent 90632bf commit 45c385d
Show file tree
Hide file tree
Showing 25 changed files with 1,280 additions and 272 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
******************************************************************************/


package org.pentaho.platform.plugin.services.importexport;
package org.pentaho.platform.api.importexport;

/*
* This program is free software; you can redistribute it and/or modify it under the
Expand All @@ -34,7 +34,7 @@
* Exception that indicates an error during import processing User: dkincade
*/
public class ExportException extends Exception {
public ExportException() {
public ExportException( ) {
}

public ExportException( final String message ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
******************************************************************************/


package org.pentaho.platform.api.util;
package org.pentaho.platform.api.importexport;



public interface IExportHelper {
public void doExport( Object exportArg );
public void doExport( Object exportArg ) throws ExportException;
public String getName();
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

package org.pentaho.platform.api.util;

import org.pentaho.platform.api.importexport.IExportHelper;

public interface IPentahoPlatformExporter {
void addExportHelper( IExportHelper helper );
IRepositoryExportLogger getRepositoryExportLogger();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*! ******************************************************************************
*
* Pentaho
*
* Copyright (C) 2024 by Hitachi Vantara, LLC : http://www.pentaho.com
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file.
*
* Change Date: 2029-07-20
******************************************************************************/

package org.pentaho.platform.api.util;

import org.apache.commons.logging.Log;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.StringLayout;

import java.io.OutputStream;

public interface IRepositoryExportLogger extends Log {


/**
* Initiates an import job. Each call creates a new log associated with the current thread.
*
* @param outputStream
* Will receive the html content of the log
* @param logLevel
* The log level to be logged.
* @param layout
* The layout to be use.
*
*/
void startJob(OutputStream outputStream, Level logLevel, StringLayout layout );

/**
* Initiates an import job. Each call creates a new log associated with the current thread.
*
* @param outputStream
* Will receive the html content of the log
* @param logLevel
* The log level to be logged.
*/
void startJob( OutputStream outputStream, Level logLevel );

/**
* Makes an "End Import Job" log entry and releases memory associated with this log.
*/
void endJob();

/**
* Log informational data. Should be called when the starting a new file and when finishing that file.
*
* @param s
* The information message to be logged.
*/
void info( String s );

/**
* Log an error.
*
* @param s
* The Error message to be logged.
*/
void error( String s );

/**
* Log debug information
*
* @param s
* The debug message to be logged
*/
void debug( String s );

/**
* Log error information
*
* @param e
* The exception to be logged.
*/
void error( Exception e );

/**
* Allows a class to check if an ImportLogger has been instantiated for the current thread.
*
* @return true if the logger is present.
*/
boolean hasLogger();
}
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@

<bean id="IPentahoPlatformExporter" class="org.pentaho.platform.plugin.services.exporter.PentahoPlatformExporter">
<constructor-arg ref="unifiedRepository"/>
<property name="repositoryExportLogger">
<bean class="org.pentaho.platform.plugin.services.importexport.Log4JRepositoryExportLogger" />
</property>
</bean>

<bean id="IRepositoryVersionManager" class="org.pentaho.platform.repository2.unified.DefaultRepositoryVersionManager" scope="singleton">
Expand Down
Loading

0 comments on commit 45c385d

Please sign in to comment.