Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tenant logs not working for admin portal related operations #3057

Closed
JanakaPushpakumara opened this issue Aug 12, 2024 · 1 comment
Closed

Comments

@JanakaPushpakumara
Copy link

JanakaPushpakumara commented Aug 12, 2024

Description

Hi Team,

The tenant logging feature for admin portal operations such as deploying throttle policies [1] not working.

The log files shoud be created in the <API-M_HOME>/repository/logs directory with the name wso2-tenant-.log file. but it is not created. and tenant logs related to the admin portal operation also available in the carbon logs not in the tenant logs.

[1] https://apim.docs.wso2.com/en/4.1.0/administer/logging-and-monitoring/logging/configuring-logging/#enabling-logs-for-a-tenant

Thanks,
Janaka.

Steps to Reproduce

Add the following configurations in the log4j2.properties file.

appenders=CARBON_CONSOLE, CARBON_LOGFILE, ...., TENANT_LOGFILE

rootLogger.appenderRef.TENANT_LOGFILE.ref = TENANT_LOGFILE
# Creates tenant-wise log files
appender.TENANT_LOGFILE.type = Routing
appender.TENANT_LOGFILE.name = TENANT_LOGFILE
appender.TENANT_LOGFILE.routes.type = Routes
appender.TENANT_LOGFILE.routes.pattern = $
appender.TENANT_LOGFILE.routes.route1.type = Route
appender.TENANT_LOGFILE.routes.route1.rolling.type = RollingFile
appender.TENANT_LOGFILE.routes.route1.rolling.name = Routing-
appender.TENANT_LOGFILE.routes.route1.rolling.fileName = /repository/logs/wso2-tenant-.log
appender.TENANT_LOGFILE.routes.route1.rolling.filePattern = /repository/logs/wso2-tenant--%d{MM-dd-yyyy}.log
appender.TENANT_LOGFILE.routes.route1.rolling.layout.type = PatternLayout
appender.TENANT_LOGFILE.routes.route1.rolling.layout.pattern = %d %p %C{1.} [%t] %m%n
appender.TENANT_LOGFILE.routes.route1.rolling.policy.type = SizeBasedTriggeringPolicy
appender.TENANT_LOGFILE.routes.route1.rolling.policy.size = 500MB

Affected Component

APIM

Version

4.1.0

Related Issues

#3016

Suggested Labels

wso2am-4.1.0

@rmsamitha
Copy link
Member

rmsamitha commented Aug 30, 2024

Hi @JanakaPushpakumara,

The initially proposed solution for the throttle policy deployment flow was to start tenant flow when deploying throttle policies. But we further analyzed the proposed fix regarding a tenant's use case. So if we implement this, when deploying throttle policy of a tenant, it will get deployed in tenant related executionplans folder. But that behavior is incorrect. Throttle policies are expected to be deployed in the central super-tenant" related "execution plans" directory (i.e. <APIM_HOME>/repository/deployment/server/executionplans), irrespective of the tenant. So even for the tenants, the execution plans are expected to be deployed in above same directory. That is the design of the throttling functionality of the product.

Due to this, execution plans deployment (throttle policy deployment) has a different behavior compared to other use cases. This is considered as a general flow irrespective of the tenant. So it is fine to print the related log files (implying policy deployment in the file system directory), in super tenant related log file even for tenants. All execution plans are deployed in super-tenant related folder.

So we are considering this behavior as not a bug. This is not needed to be fixed.

Thanks,
Samitha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants