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

Enable show SQL query for develop mode #702

Merged
merged 4 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ public void setLocation(String location) {

private boolean enableScopeAuthz = true;

private boolean showSql = false;

private LocalResources localResources = new LocalResources();

private Logo logo = new Logo();
Expand Down Expand Up @@ -615,6 +617,14 @@ public void setEnableScopeAuthz(boolean enableScopeAuthz) {
this.enableScopeAuthz = enableScopeAuthz;
}

public boolean isShowSql() {
return showSql;
}

public void setShowSql(boolean showSql) {
this.showSql = showSql;
}

public LoginButtonProperties getLoginButton() {
return loginButton;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ public class JpaConfig extends JpaBaseConfiguration {

public static final String ECLIPSELINK_LOGGING_LEVEL = "eclipselink.logging.level";
public static final String ECLIPSELINK_LOGGING_LEVEL_SQL = "eclipselink.logging.level.sql";
public final IamProperties iamProperties;

protected JpaConfig(DataSource dataSource, JpaProperties properties,
ObjectProvider<JtaTransactionManager> jtaTransactionManager) {
ObjectProvider<JtaTransactionManager> jtaTransactionManager, IamProperties iamProperties) {
super(dataSource, properties, jtaTransactionManager);
this.iamProperties = iamProperties;
}

@Autowired
Expand All @@ -68,7 +70,7 @@ protected Map<String, Object> getVendorProperties() {
map.put(ECLIPSELINK_LOGGING_LEVEL_SQL, "OFF");
map.put("eclipselink.cache.shared.default", "false");

if (System.getProperty("iam.show_sql") != null) {
if (iamProperties.isShowSql()) {
map.put(ECLIPSELINK_LOGGING_LEVEL, "FINE");
map.put(ECLIPSELINK_LOGGING_LEVEL_SQL, "FINE");
map.put("eclipselink.logging.parameters", "true");
Expand Down
2 changes: 1 addition & 1 deletion iam-login-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ spring:
pathmatch:
matching-strategy: "ant-path-matcher"
iam:

host: ${IAM_HOST:localhost}
baseUrl: ${IAM_BASE_URL:http://${iam.host}:8080}
issuer: ${IAM_ISSUER:http://${iam.host}:8080}
topbarTitle: ${IAM_TOPBAR_TITLE:INDIGO IAM for ${iam.organisation.name}}
showSql: ${IAM_DATABASE_SHOW_SQL:false}

jwk:
keystore-location: ${IAM_KEY_STORE_LOCATION:classpath:keystore.jwks}
Expand Down
Loading