Skip to content

chore: Improve logging for sidecar#104

Merged
gjreda merged 1 commit into
mainfrom
101-write-sidecar-logs-to-filesystem
Jun 7, 2023
Merged

chore: Improve logging for sidecar#104
gjreda merged 1 commit into
mainfrom
101-write-sidecar-logs-to-filesystem

Conversation

@gjreda

@gjreda gjreda commented Jun 7, 2023

Copy link
Copy Markdown
Collaborator

Temporarily logging to /tmp for now, but ideally we'd log this data in the $APPDATA directory. I don't think the sidecar has a way of knowing the $APPDATA path unless we pass it in.

❯ tail -f refstudio-sidecar.log
2023-06-06 20:25:23,575 - sidecar.ingest - INFO - Starting ingestion for project: project-x
2023-06-06 20:25:23,575 - sidecar.ingest - INFO - Input directory: /Users/greg/Library/Application Support/com.tauri.dev/project-x/uploads
2023-06-06 20:25:23,575 - sidecar.ingest - INFO - Found 2 pdf files to process
2023-06-06 20:25:23,575 - sidecar.ingest - INFO - Calling Grobid server...
2023-06-06 20:25:52,351 - sidecar.ingest - INFO - Finished calling Grobid server
2023-06-06 20:25:52,352 - sidecar.ingest - INFO - Grobid successfully parsed file: test.pdf
2023-06-06 20:25:52,352 - sidecar.ingest - WARNING - Grobid failed to parse file: FActScore-.Fine-grained.Atomic.Evaluation.of.Factual.Precision.in.Long.Form.Text.Generation.pdf
2023-06-06 20:25:52,352 - sidecar.ingest - INFO - Found 1 xml files to parse
2023-06-06 20:25:52,368 - sidecar.ingest - INFO - Found 1 json reference files
2023-06-06 20:25:52,368 - sidecar.ingest - INFO - Creating Reference from file: test.json
2023-06-06 20:25:52,369 - sidecar.ingest - INFO - Finished ingestion for project: project-x
2023-06-06 20:25:52,369 - sidecar.ingest - INFO - Response: {'project_name': 'project-x', 'references': [{'source_filename': 'test.pdf', 'filename_md5': '754dc77d28e62763c4916970d595a10f', 'title': 'A Few Useful Things to Know about Machine Learning', 'authors': [{'full_name': 'Pedro Domingos', 'given_name': 'Pedro', 'surname': 'Domingos', 'email': '[email protected]'}]}]}

@gjreda gjreda linked an issue Jun 7, 2023 that may be closed by this pull request
@gjreda gjreda marked this pull request as ready for review June 7, 2023 03:35
@gjreda gjreda requested review from cguedes and sehyod June 7, 2023 03:35
@cguedes

cguedes commented Jun 7, 2023

Copy link
Copy Markdown
Collaborator

I don't think the sidecar has a way of knowing the $APPDATA path unless we pass it in.

@gjreda What do you think about creating a task that setup the sidecar with settings? This will be useful for sending paths ($APPDATA, ...) and also configurations (e.g. api keys).

Comment thread python/sidecar/ingest.py
logger.setLevel(logging.INFO)
handler = logging.FileHandler(
os.path.join(
os.environ.get("SIDECAR_LOG_DIR", "/tmp"), "refstudio-sidecar.log"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we call it refstudio-sidecar-ingest.log instead?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intention is to have one unified log for the sidecar that includes both ingest and interactions.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I see your point.

@gjreda

gjreda commented Jun 7, 2023

Copy link
Copy Markdown
Collaborator Author

@gjreda What do you think about creating a task that setup the sidecar with settings? This will be useful for sending paths ($APPDATA, ...) and also configurations (e.g. api keys).

Yea, I agree. I think we're starting to see a need for some sort of broader settings configuration that can be shared by front and back end.

@gjreda gjreda merged commit cf016c1 into main Jun 7, 2023
@gjreda gjreda deleted the 101-write-sidecar-logs-to-filesystem branch June 7, 2023 16:16
sehyod pushed a commit that referenced this pull request Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write sidecar logs to filesystem

2 participants