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

SOLR-16883: Use postlogs tool from windows and unix via solr cli infrastructure. #1786

Merged
merged 10 commits into from
Jul 31, 2023

Conversation

epugh
Copy link
Contributor

@epugh epugh commented Jul 14, 2023

https://issues.apache.org/jira/browse/SOLR-16883

Description

experimenting with making the postlogs tool part of SolrCLI so it runs on windows and unix and elminate custom shell scripting.

Let's see if we can't get more usage/awareness of Solr consuming Solr logs!

Solution

Similar to the SimplePostTool Approach...

Tests

ran bats, but need one for bin/solr postlogs

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

@sonatype-lift
Copy link

sonatype-lift bot commented Jul 14, 2023

Sonatype Lift is retiring

Sonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console.
We are extremely grateful and thank you for your support over the years.

📖 Read about the impacts and timeline

@epugh
Copy link
Contributor Author

epugh commented Jul 14, 2023

@Willdotwhite @mkhludnev here is another one iwht changes to windows bin.cmd that owuld be nice to get independent test!

@Willdotwhite
Copy link
Contributor

Willdotwhite commented Jul 16, 2023

Tested @epugh 👍🏻 - I've no idea what I just did, but it certainly did it:

PS C:\Users\Will\Projects\solr\solr\packaging\build\dev\bin> .\solr.cmd postlogs -url http://localhost:8983/solr/gettingstarted -rootdir C:\Users\Will\Projects\solr\solr\packaging\build\dev\server\logs
Sending batch of 300 log records...
Batch sent
Sending batch of 300 log records...
...
Sending last batch ...
Batch sent
Committed

@Willdotwhite
Copy link
Contributor

The -help command prints the following, but doesn't actually explain what the command does - should that live in the help output, or do we expect people to check the online docs?

PS C:\Users\Will\Projects\solr\solr\packaging\build\dev\bin> .\solr.cmd postlogs -help                                                                                                                   
usage: postlogs
 -help            Print this message
 -rootdir <arg>    All files found at or below the root will be indexed.
 -url <arg>       Address of the collection, example
                  http://localhost:8983/solr/collection1/.
 -verbose         Enable more verbose command output.

@joel-bernstein
Copy link
Contributor

Sounds like a good idea to me.

@epugh
Copy link
Contributor Author

epugh commented Jul 21, 2023

Sounds like a good idea to me.

Terrific! Thanks for chiming in ;-).

@epugh
Copy link
Contributor Author

epugh commented Jul 21, 2023

@Willdotwhite so yeah, I have been moving the detailed help over to the Ref Guide. Commons-cli doesn't make it easy to have a pretty/detailed "this is what the tool does", as far as I know. So that IS something we lose...

@epugh
Copy link
Contributor Author

epugh commented Jul 24, 2023

@joel-bernstein I ran with it a bit and deprecated the SolrLogPostTool in favour of PostLogsTool and updated the ref guide as well in this PR.

@epugh epugh merged commit 279b9cd into apache:main Jul 31, 2023
2 of 4 checks passed
epugh added a commit that referenced this pull request Jul 31, 2023
…astructure. (#1786)

Postlogs tool only works on Linux, and was it's own implementation of a command line tool, with different patterns then the other tools.   Migrate over to "bin/solr postlogs" and it now works like other CLI tools, including working on Windows.
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.

3 participants