-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
4 changed files
with
239 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright (c) 2016 Network New Technologies Inc. | ||
~ | ||
~ 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. | ||
--> | ||
|
||
<configuration> | ||
<!-- TODO create logger for audit only. | ||
http://stackoverflow.com/questions/2488558/logback-to-log-different-messages-to-two-files --> | ||
<turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter"> | ||
<Marker>PROFILER</Marker> | ||
<!--<OnMatch>DENY</OnMatch>--> | ||
<OnMatch>NEUTRAL</OnMatch> | ||
</turboFilter> | ||
|
||
<!--stdout log--> | ||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> | ||
<!-- encoders are assigned the type | ||
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> | ||
<encoder> | ||
<pattern>%d{HH:mm:ss.SSS} [%thread] %X{sId} %X{cId} %-5level %class{36}:%L %M - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<!--stdout-file log--> | ||
<appender name="stdout-file" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>log/stdout.log.json</file> | ||
<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder"> | ||
<providers> | ||
<timestamp> | ||
<fieldName>timestamp</fieldName> | ||
<pattern>yyyy-MM-dd'T'HH:mm:ss.SSSZ</pattern> | ||
</timestamp> | ||
<pattern> | ||
<pattern> | ||
{ | ||
"thread": "%thread", | ||
"level": "%-5level", | ||
"logger": "%logger{64}", | ||
"correlationId": "%X{cId}", | ||
"serviceId": "%X{sId}", | ||
"class": "%F", | ||
"lineNumber": "%class{64}:%L", | ||
"method": "%M", | ||
"logMessage": "#tryJson{%message}" | ||
} | ||
</pattern> | ||
</pattern> | ||
<rootStackTraceElement/> | ||
<stackTrace/> | ||
</providers> | ||
</encoder> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> | ||
<fileNamePattern>log/stdout.log.json.%i.zip</fileNamePattern> | ||
<minIndex>1</minIndex> | ||
<maxIndex>5</maxIndex> <!-- max number of archived logs that are kept --> | ||
</rollingPolicy> | ||
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> | ||
<maxFileSize>200MB | ||
</maxFileSize> <!-- The size of the logfile that triggers a switch to a new logfile, and the current one archived --> | ||
</triggeringPolicy> | ||
</appender> | ||
|
||
<!--audit log--> | ||
<appender name="audit" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<file>log/schedular-audit.log.json</file> <!-- logfile location --> | ||
<encoder> | ||
<pattern>%msg%n</pattern> <!-- the layout pattern used to format log entries --> | ||
<immediateFlush>true</immediateFlush> | ||
</encoder> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> | ||
<fileNamePattern>log/schedular-audit.log.json.%i.zip</fileNamePattern> | ||
<minIndex>1</minIndex> | ||
<maxIndex>5</maxIndex> <!-- max number of archived logs that are kept --> | ||
</rollingPolicy> | ||
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> | ||
<maxFileSize>200MB | ||
</maxFileSize> <!-- The size of the logfile that triggers a switch to a new logfile, and the current one archived --> | ||
</triggeringPolicy> | ||
</appender> | ||
|
||
<root level="debug"> | ||
<appender-ref ref="stdout"/> | ||
<appender-ref ref="stdout-file"/> | ||
</root> | ||
|
||
<logger name="Audit" level="debug" additivity="false"> | ||
<appender-ref ref="audit"/> | ||
</logger> | ||
|
||
<logger name="com.networknt" level="trace" additivity="false"> | ||
<appender-ref ref="stdout"/> | ||
</logger> | ||
|
||
</configuration> |
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,113 @@ | ||
# server.yml | ||
server.httpPort: 9080 | ||
server.enableHttp: true | ||
server.enableHttps: false | ||
server.enableHttp2: false | ||
server.serviceId: com.networknt.client-gateway-1.0.0 | ||
server.environment: dev | ||
|
||
# router.yml | ||
router.maxRequestTime: 30000 | ||
|
||
# pathPrefixService.yml | ||
pathPrefixService.mapping: | ||
# /gateway/Migration/1.0.0: Migration | ||
/v1/pets: com.networknt.petstore-1.0.0 | ||
# service.yml | ||
service.singletons: | ||
- com.networknt.registry.URL: | ||
- com.networknt.registry.URLImpl: | ||
parameters: | ||
# com.networknt.portal.hybrid.query-1.0.0: https://hybrid-query1:8440,https://hybrid-query2:8441,https://hybrid-query3:8442 | ||
# com.networknt.portal.hybrid.command-1.0.0: https://hybrid-command:8439 | ||
# com.networknt.oauth-key-1.0.0: https://oauth-key:6886 | ||
# com.networknt.oauth-token-1.0.0: https://oauth-token:6882 | ||
# com.networknt.oauth-code-1.0.0: https://oauth-code:6881 | ||
# com.networknt.reference-1.0.0: https://reference:2498 | ||
# com.networknt.config-server-1.0.0: https://localhost:8435 | ||
# com.networknt.controller-1.0.0: https://controller-node1:8438,https://controller-node2:8437,https://controller-node3:8436 | ||
# com.networknt.scheduler-1.0.0: https://scheduler-node1:8401,https://scheduler-node2:8402,https://scheduler-node3:8403 | ||
# Migration: https://lightgateway-dev.networknt.com:8443 | ||
com.networknt.petstore-1.0.0: https://localhost:9443 | ||
- com.networknt.registry.Registry: | ||
- com.networknt.registry.support.DirectRegistry | ||
- com.networknt.balance.LoadBalance: | ||
- com.networknt.balance.RoundRobinLoadBalance | ||
- com.networknt.cluster.Cluster: | ||
- com.networknt.cluster.LightCluster | ||
- com.networknt.utility.Decryptor: | ||
- com.networknt.decrypt.AESDecryptor | ||
- com.networknt.handler.ResponseInterceptorHandler: | ||
- com.networknt.restrans.ResponseTransformerHandler | ||
|
||
# handler.yml | ||
handler.basePath: / | ||
handler.handlers: | ||
# Light-framework cross-cutting concerns implemented in the microservice | ||
- com.networknt.exception.ExceptionHandler@exception | ||
- com.networknt.metrics.MetricsHandler@metrics | ||
- com.networknt.traceability.TraceabilityHandler@traceability | ||
- com.networknt.correlation.CorrelationHandler@correlation | ||
# Cors handler to handler post/put pre-flight. It is not used in the sidecar but only in the router. | ||
- com.networknt.cors.CorsHttpHandler@cors | ||
- com.networknt.openapi.OpenApiHandler@specification | ||
- com.networknt.openapi.JwtVerifyHandler@security | ||
- com.networknt.body.BodyHandler@body | ||
- com.networknt.audit.AuditHandler@audit | ||
- com.networknt.sanitizer.SanitizerHandler@sanitizer | ||
- com.networknt.openapi.ValidatorHandler@validator | ||
# Header middleware to manipulate request and/or response headers before or after downstream server | ||
- com.networknt.header.HeaderHandler@header | ||
# Rate limit middleware to prevent DDoS attacks externally or throttle requests internally | ||
- com.networknt.limit.LimitHandler@limit | ||
# IP whitelist handler to allow only one or several IPs to connect to the gateway. | ||
# - com.networknt.whitelist.WhitelistHandler@whitelist | ||
# Direct requests to named services based on the request path | ||
# - com.networknt.router.middleware.GatewayServiceDictHandler@path | ||
- com.networknt.router.middleware.PathPrefixServiceHandler@prefix | ||
- com.networknt.router.middleware.GatewaySAMLTokenHandler@saml | ||
- com.networknt.router.GatewayRouterHandler@router | ||
- com.networknt.proxy.LightProxyHandler@proxy | ||
- com.networknt.proxy.ProxyServerInfoHandler@proxyServerInfo | ||
# - com.networknt.resource.VirtualHostHandler@virtual | ||
# Customer business domain specific cross-cutting concerns handlers | ||
# - com.example.validator.CustomizedValidator@custvalidator | ||
# Framework endpoint handlers | ||
# Control Pane middleware handlers and API handler | ||
- com.networknt.chaos.KillappAssaultHandler@killapp | ||
- com.networknt.chaos.LatencyAssaultHandler@latency | ||
- com.networknt.chaos.MemoryAssaultHandler@memory | ||
- com.networknt.chaos.ExceptionAssaultHandler@exchaos | ||
- com.networknt.chaos.ChaosMonkeyGetHandler@chaosget | ||
- com.networknt.chaos.ChaosMonkeyPostHandler@chaospost | ||
- com.networknt.health.HealthGetHandler@health | ||
- com.networknt.info.ServerInfoGetHandler@info | ||
- com.networknt.logging.handler.LoggerGetHandler@getLogger | ||
- com.networknt.logging.handler.LoggerPostHandler@postLogger | ||
- com.networknt.logging.handler.LoggerGetLogContentsHandler@getLogContents | ||
- com.networknt.config.reload.handler.ModuleRegistryGetHandler@modules | ||
- com.networknt.config.reload.handler.ConfigReloadHandler@configReload | ||
- com.networknt.specification.SpecDisplayHandler@spec | ||
- com.networknt.specification.SpecSwaggerUIHandler@swaggerui | ||
- com.networknt.specification.FaviconHandler@favicon | ||
- com.networknt.handler.SinkConduitInjectorHandler@sink | ||
|
||
handler.chains.default: | ||
- exception | ||
- metrics | ||
- limit | ||
- traceability | ||
- correlation | ||
- cors | ||
# - stateless | ||
- sink | ||
- header | ||
#- path | ||
#- specification | ||
#- security | ||
#- body | ||
#- audit | ||
#- sanitizer | ||
#- validator | ||
- prefix | ||
- router |
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