-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29a01e7
commit c89997c
Showing
14 changed files
with
510 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
native/src/main/java/io/ballerina/stdlib/http/api/logging/logger/HttpAccessLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 LLC. licenses this file to you 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 io.ballerina.stdlib.http.api.logging.logger; | ||
|
||
import io.ballerina.stdlib.http.transport.contractimpl.common.accesslog.HttpAccessLogFormat; | ||
|
||
public class HttpAccessLogger extends HttpLogger { | ||
HttpAccessLogFormat format = HttpAccessLogFormat.FLAT; | ||
public HttpAccessLogger(String name) { | ||
super(name); | ||
} | ||
|
||
public HttpAccessLogFormat getFormat() { | ||
return format; | ||
} | ||
|
||
public void setFormat(HttpAccessLogFormat format) { | ||
this.format = format; | ||
} | ||
} |
188 changes: 188 additions & 0 deletions
188
native/src/main/java/io/ballerina/stdlib/http/api/logging/logger/HttpLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 LLC. licenses this file to you 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 io.ballerina.stdlib.http.api.logging.logger; | ||
|
||
import io.netty.util.internal.logging.AbstractInternalLogger; | ||
import io.netty.util.internal.logging.InternalLogLevel; | ||
|
||
public class HttpLogger extends AbstractInternalLogger { | ||
|
||
protected HttpLogger(String name) { | ||
super(name); | ||
} | ||
|
||
@Override | ||
public boolean isTraceEnabled() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void trace(String s) { | ||
|
||
} | ||
|
||
@Override | ||
public void trace(String s, Object o) { | ||
|
||
} | ||
|
||
@Override | ||
public void trace(String s, Object o, Object o1) { | ||
|
||
} | ||
|
||
@Override | ||
public void trace(String s, Object... objects) { | ||
|
||
} | ||
|
||
@Override | ||
public void trace(String s, Throwable throwable) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean isDebugEnabled() { | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public void debug(String s) { | ||
|
||
} | ||
|
||
@Override | ||
public void debug(String s, Object o) { | ||
|
||
} | ||
|
||
@Override | ||
public void debug(String s, Object o, Object o1) { | ||
|
||
} | ||
|
||
@Override | ||
public void debug(String s, Object... objects) { | ||
|
||
} | ||
|
||
@Override | ||
public void debug(String s, Throwable throwable) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean isInfoEnabled() { | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public void info(String s) { | ||
|
||
} | ||
|
||
@Override | ||
public void info(String s, Object o) { | ||
|
||
} | ||
|
||
@Override | ||
public void info(String s, Object o, Object o1) { | ||
|
||
} | ||
|
||
@Override | ||
public void info(String s, Object... objects) { | ||
|
||
} | ||
|
||
@Override | ||
public void info(String s, Throwable throwable) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean isWarnEnabled() { | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public void warn(String s) { | ||
|
||
} | ||
|
||
@Override | ||
public void warn(String s, Object o) { | ||
|
||
} | ||
|
||
@Override | ||
public void warn(String s, Object... objects) { | ||
|
||
} | ||
|
||
@Override | ||
public void warn(String s, Object o, Object o1) { | ||
|
||
} | ||
|
||
@Override | ||
public void warn(String s, Throwable throwable) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean isErrorEnabled() { | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public void error(String s) { | ||
|
||
} | ||
|
||
@Override | ||
public void error(String s, Object o) { | ||
|
||
} | ||
|
||
@Override | ||
public void error(String s, Object o, Object o1) { | ||
|
||
} | ||
|
||
@Override | ||
public void error(String s, Object... objects) { | ||
|
||
} | ||
|
||
@Override | ||
public void error(String s, Throwable throwable) { | ||
|
||
} | ||
|
||
@Override | ||
public void log(InternalLogLevel level, String msg) { | ||
super.log(level, msg); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
native/src/main/java/io/ballerina/stdlib/http/api/logging/logger/HttpLoggerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 LLC. licenses this file to you 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 io.ballerina.stdlib.http.api.logging.logger; | ||
|
||
import io.netty.util.internal.logging.InternalLogger; | ||
import io.netty.util.internal.logging.InternalLoggerFactory; | ||
|
||
public class HttpLoggerFactory extends InternalLoggerFactory { | ||
@Override | ||
protected InternalLogger newInstance(String name) { | ||
if (name.contains("accesslog")) { | ||
return new HttpAccessLogger(name); | ||
} | ||
return this.newInstance(name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.