Skip to content
Snippets Groups Projects
Commit a3ad1997 authored by Stephen Henderson's avatar Stephen Henderson
Browse files

Default logging is now `@Inject`-able

parent 869b2ee8
No related branches found
No related tags found
1 merge request!6Trusted ibm
// Copyright © Amazon Web Services
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.indexer.aws.di;
import org.opengroup.osdu.core.common.service.logging.DefaultLog;
import org.opengroup.osdu.core.common.service.logging.ILogger;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.stereotype.Component;
@Component
public class DpsLogFactory extends AbstractFactoryBean<ILogger> {
@Override
protected ILogger createInstance() throws Exception {
return new DefaultLog();
}
@Override
public Class<?> getObjectType() {
return ILogger.class;
}
}
\ No newline at end of file
// Copyright © Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.indexer.azure.di;
import org.opengroup.osdu.core.common.service.logging.DefaultLog;
import org.opengroup.osdu.core.common.service.logging.ILogger;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
@Component
@RequestScope
public class DpsLogFactory implements FactoryBean<ILogger> {
@Override
public ILogger getObject() throws Exception {
return new DefaultLog();
}
@Override
public Class<?> getObjectType() {
return ILogger.class;
}
}
// Copyright 2017-2019, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.indexer.di;
import org.opengroup.osdu.core.common.service.logging.ILogger;
import org.opengroup.osdu.core.gcp.logging.logger.AppEngineLoggingProvider;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
@Component
@RequestScope
public class DpsLogFactory extends AbstractFactoryBean<ILogger> {
private AppEngineLoggingProvider appEngineLoggingProvider = new AppEngineLoggingProvider();
@Override
protected ILogger createInstance() throws Exception {
return appEngineLoggingProvider.getLogger();
}
@Override
public Class<?> getObjectType() {
return ILogger.class;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment