🛠 Logs on ES auth
This commit is contained in:
+15
-2
@@ -40,7 +40,7 @@ export default class ElasticSearch extends SearchAdapter implements SearchAdapte
|
||||
|
||||
public async connect() {
|
||||
try {
|
||||
const clientOptions: any = {
|
||||
let clientOptions: any = {
|
||||
node: this.configuration.endpoint,
|
||||
ssl: {
|
||||
rejectUnauthorized: false,
|
||||
@@ -48,6 +48,7 @@ export default class ElasticSearch extends SearchAdapter implements SearchAdapte
|
||||
};
|
||||
|
||||
if (this.configuration.useAuth) {
|
||||
logger.info(`Using auth for ES client`);
|
||||
clientOptions.auth = {
|
||||
username: this.configuration.username,
|
||||
password: this.configuration.password,
|
||||
@@ -56,7 +57,19 @@ export default class ElasticSearch extends SearchAdapter implements SearchAdapte
|
||||
|
||||
this.client = new Client(clientOptions);
|
||||
} catch (e) {
|
||||
logger.error(`Unable to connect to ElasticSearch at ${this.configuration.endpoint}`);
|
||||
logger.error(
|
||||
`Unable to connect to ElasticSearch for options: ${JSON.stringify({
|
||||
node: this.configuration.endpoint,
|
||||
auth: {
|
||||
useAuth: this.configuration.useAuth,
|
||||
username: this.configuration.username,
|
||||
password: this.configuration.password,
|
||||
},
|
||||
ssl: {
|
||||
rejectUnauthorized: false,
|
||||
},
|
||||
})} at: ${this.configuration.endpoint}`,
|
||||
);
|
||||
}
|
||||
this.startBulkReader();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user