Giter Site home page Giter Site logo

cctail's People

Contributors

fgiust avatar fgiustmw avatar sschwartzman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cctail's Issues

Support for the security log on SFCC

Hi There,

I wonder if you have considered pulling the security logs (/on/demandware.servlet/webdav/Sites/Securitylogs) at all?
https://documentation.b2c.commercecloud.salesforce.com/DOC4/index.jsp?topic=%2Fcom.demandware.dochelp%2Fcontent%2Fb2c_commerce%2Ftopics%2Fsite_development%2Fb2c_understanding_log_files.html

I think they would be useful to our use case but I don't see any reference to them in the current logging time. Forgive me if i've missed something.

Many thanks.

George

HTTP 401 not causing code to fall into 'error' path

Hi @fgiust ! I'm excited to use cctail, I'm actually looking into having it pipe the logs to an ingestion tool like fluentd, but that's besides the point right now. ;) For right now though, I'm just playing with it to see how it works today. For an SFCC sandbox for which I don't have an API Client create yet, I tried my personal client_id and secret_id. I would expect this to fail since it is expecting an API Client creds. However when I run it this way, it doesn't throw any 401 failures, it just comes back with an empty log list, like this:

seth:cctail $ node dist/cctail.js
cctail - v1.2.0 - (c) openmind

Authenticating using oauth - client_id REDACTED

✔ Select logs on [REDACTED.demandware.net] ›
No log selected, exiting.

I added a couple log messages to logfetcher.ts to see what's going on, here's the result:

seth:cctail $ node dist/cctail.js
cctail - v1.2.0 - (c) openmind

Authenticating using oauth - client_id REDACTED

Response:
{
  error_description: 'Client authentication failed',
  error: 'invalid_client'
}
Status Code: 401

Response: 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>401 - Authorization Required.</title>
	<link rel="STYLESHEET" type="text/css" href="/waroot/style.css">
</head>
<body>
	<h1>Authorization Required</h1>
	<img src="/waroot/system_arrow.gif" width="21" height="21" alt="" border="0">
	<p class="system_info">
		This request requires HTTP authentication.
	</p>
	<hr>
</body>
</html>
Status Code: 401

✔ Select logs on [REDACTED.demandware.net] ›
No log selected, exiting.

So it seems the Axios requests are getting 401 errors back (which I would expect!), but the catch blocks aren't catching them. I'll keep playing with the code, I suspect it's because it's to do with await or how Axios handles error codes.

cctail pulling all the logs even after mentioning the specific log types in the config file

We have created 7 different docker containers for pulling different log types but we could see duplicates in the NR as each container is pulling all the other log types as well rather the ones mentioned in the config file
these are the different log types used by each different containers

"log_types": ["customwarn", "warn"]
"log_types": ["customerror", "customfatal"]
log_types: ["error", "fatal"]
"log_types": ["sysevent", "syslog", "system"]
"log_types": ["service", "jobs"]
"log_types": ["custom"]
log_types: ["custominfo", "info"]

The sample config file of cctail is below::

/ # cat ./log.conf.json
{
"profiles": {
"sfcc": {
"hostname": "ENV_SFCC_HOSTNAME",
"client_id": "ENV_SFCC_CLIENT_ID",
"client_secret": "ENV_SFCC_CLIENT_SECRET",
"polling_interval": 30,
"log_types": ["service", "jobs"]
}
},
"interactive": false,
"fluent": {
"enabled": true
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.