Skip to content

Commit

Permalink
#632 - Use static loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementBareth committed Nov 16, 2022
1 parent 5de7647 commit 56752ef
Show file tree
Hide file tree
Showing 142 changed files with 599 additions and 385 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public class JoinedAutoStaleObjectEvictingPersister extends JoinedSubclassEntityPersister {

private Logger log = LoggerFactory.getLogger(this.getClass());
private static Logger log = LoggerFactory.getLogger(JoinedAutoStaleObjectEvictingPersister.class);

public JoinedAutoStaleObjectEvictingPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy,
PersisterCreationContext creationContext) throws HibernateException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public class SingleAutoStaleObjectEvictingPersister extends SingleTableEntityPersister {

private Logger log = LoggerFactory.getLogger(this.getClass());
private static Logger log = LoggerFactory.getLogger(SingleAutoStaleObjectEvictingPersister.class);

public SingleAutoStaleObjectEvictingPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy, NaturalIdDataAccess naturalIdRegionAccessStrategy,
PersisterCreationContext creationContext) throws HibernateException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.meveo.service.script.ScriptInterface;
import org.meveo.util.ApplicationProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Asynchronous FlatFile processing.
Expand All @@ -50,8 +51,7 @@ public class FlatFileProcessingAsync {
private static final String THREAD_POOL_SIZE = FlatFileProcessingJob.FLAT_FILE_PROCESSING_JOB_THREAD_POOL_SIZE;

/** The log. */
@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(FlatFileProcessingAsync.class);

/** The unit flat file processing job bean. */
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
import org.meveo.model.mediation.MeveoFtpFile;
import org.meveo.service.admin.impl.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Stateless
public class MeveoDefaultFtplet extends DefaultFtplet {
@Inject
private Logger log;

private static Logger log = LoggerFactory.getLogger(MeveoDefaultFtplet.class);

@Inject
@FileUpload

private Event<MeveoFtpFile> upload;

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class MeveoFtpUserManager extends AbstractUserManager {
private static final int HOUR = 60 * 60;
private static final String ADMINISTRATOR = "administrateur";

private Logger log = LoggerFactory.getLogger(MeveoFtpUserManager.class);
private static Logger log = LoggerFactory.getLogger(MeveoFtpUserManager.class);

private UserService userService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.meveo.commons.utils.StringUtils;
import org.meveo.service.admin.impl.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
*
Expand All @@ -31,8 +32,9 @@
// @Startup
@Singleton
public class MeveoMinaFTPListener {
@Inject
private Logger log;

private static Logger log = LoggerFactory.getLogger(MeveoMinaFTPListener.class);

@Inject
private UserService userService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.meveo.service.script.ScriptInterface;
import org.meveo.util.ApplicationProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
Expand All @@ -31,8 +32,7 @@
public class FileProcessingJobBean {

/** The log. */
@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(FileProcessingJobBean.class);

/** The script instance service. */
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.meveo.service.script.ScriptInstanceService;
import org.meveo.service.script.ScriptInterface;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* The FilteringJobBean have 2 mains inputs :ScriptInstance and Filter. For each filtered entity the scriptInstance are executed.
Expand All @@ -41,8 +42,7 @@
@Stateless
public class FilteringJobBean {

@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(FilteringJobBean.class);

@Inject
private FilterService filterService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.meveo.service.script.ScriptInstanceService;
import org.meveo.service.script.ScriptInterface;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* The Class FlatFileProcessingJobBean.
Expand All @@ -44,8 +45,7 @@
public class FlatFileProcessingJobBean {

/** The log. */
@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(FlatFileProcessingJobBean.class);

/** The script instance service. */
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.meveo.service.job.FtpImportedFileService;
import org.meveo.service.job.JobExecutionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* The Class FtpAdapterJobBean.
Expand All @@ -49,8 +50,7 @@
public class FtpAdapterJobBean {

/** The log. */
@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(FtpAdapterJobBean.class);

/** The ftp imported file service. */
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import org.meveo.commons.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @author Edward P. Legaspi
Expand All @@ -31,8 +32,7 @@ public static void main(String args[]) {
new GenerateMediationImport();
}

@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(GenerateMediationImport.class);

public GenerateMediationImport() {
System.out.println("start creating mediation file...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.meveo.service.crm.impl.CustomFieldInstanceService;
import org.meveo.service.finance.ReportExtractService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* List all ReportExtract and dispatched for asynch execution.
Expand All @@ -38,8 +39,7 @@ public class ReportExtractJobBean implements Serializable {

private static final long serialVersionUID = 9159856207913605563L;

@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(ReportExtractJobBean.class);

@Inject
private CustomFieldInstanceService customFieldInstanceService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import org.meveo.service.script.ScriptInstanceService;
import org.meveo.service.script.ScriptInterface;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ScriptingJobBean {

@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(ScriptingJobBean.class);

@Inject
private ScriptInstanceService scriptInstanceService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.meveo.service.finance.ReportExtractService;
import org.meveo.service.script.finance.ReportExtractScript;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Extension class for JobExtractReport to start a new transaction.
Expand All @@ -31,8 +32,7 @@ public class UnitReportExtractJobBean {

private ParamBean paramBean = ParamBean.getInstance();

@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(UnitReportExtractJobBean.class);

@Inject
private ReportExtractService reportExtractService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.meveo.model.wf.Workflow;
import org.meveo.service.wf.WorkflowService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
*
Expand All @@ -23,8 +24,7 @@
@Stateless
public class UnitWorkflowJobBean {

@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(UnitWorkflowJobBean.class);

@Inject
private WorkflowService workflowService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
import org.meveo.service.filter.FilterService;
import org.meveo.service.wf.WorkflowService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Stateless
public class WorkflowJobBean {

@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(WorkflowJobBean.class);

@Inject
private FilterService filterService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.neo4j.driver.Session;
import org.neo4j.driver.Transaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Stateless
public class DWHQueryBean {
Expand All @@ -55,8 +56,7 @@ public class DWHQueryBean {
@MeveoJpa
private EntityManagerWrapper emWrapper;

@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(DWHQueryBean.class);

@Inject
private JobExecutionService jobExecutionService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class JobLoggingInterceptor implements Serializable{
*
*/
private static final long serialVersionUID = 8509493016090519457L;
private Logger log = LoggerFactory.getLogger(this.getClass());
private static Logger log = LoggerFactory.getLogger(JobLoggingInterceptor.class);

@AroundInvoke
public Object aroundInvoke(InvocationContext invocationContext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.meveo.service.script.ScriptInstanceService;
import org.primefaces.model.SortOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Takes care of initializing/loading various application services/data
Expand Down Expand Up @@ -52,8 +53,7 @@ public class ApplicationInitializer {
@Inject
private EntityManagerProvider entityManagerProvider;

@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(ApplicationInitializer.class);

@Inject
private NotificationCacheContainerProvider notifCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import org.meveo.service.storage.RemoteRepositoryService;
import org.meveo.service.storage.RepositoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @author Edward P. Legaspi | czetsuya@gmail.com
Expand All @@ -92,8 +93,7 @@ public class StartupListener {
@Inject
private RemoteRepositoryService remoteRepositoryService;

@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(StartupListener.class);

@Inject
@MeveoJpa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.meveo.jpa.MeveoJpa;
import org.meveo.model.patch.PatchExecution;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Service to execute patches
Expand All @@ -34,8 +35,7 @@ public class PatchExecutionService implements MeveoInitializer {
@Any
private Instance<Patch> patches;

@Inject
private Logger log;
private static Logger log = LoggerFactory.getLogger(PatchExecutionService.class);

/**
* Execute every non-executed patch
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
import org.meveo.commons.utils.StringUtils;
import org.meveo.model.audit.logging.AuditLog;
import org.meveo.service.base.PersistenceService;
import org.meveo.service.custom.CustomEntityTemplateService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @author Edward P. Legaspi
**/
@Stateless
public class AuditEventDBWriter extends PersistenceService<AuditLog> {

public void write(AuditEvent auditEvent) throws BusinessException {
AuditLog auditLog = new AuditLog();
auditLog.setAction(auditEvent.getAction());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

public class CsvBuilder {

private Logger log = LoggerFactory.getLogger(CsvBuilder.class);
private static Logger log = LoggerFactory.getLogger(CsvBuilder.class);

/** Creates a new instance of CsvBuilder */
private final static String BREAK_LINE = "\r\n";
Expand Down
Loading

0 comments on commit 56752ef

Please sign in to comment.